Migrate HorizontalScrollingTest to FU 4
Move helper classes to separate folder
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index 34569f2..0b186d5 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -37,6 +37,7 @@
import UnitTest.Tests.FloatTest;
import UnitTest.Tests.FlowModelTest;
import UnitTest.Tests.GeneralFunctionsTest;
+ import UnitTest.Tests.HorizontalScrollingTest;
import UnitTest.Tests.OperationTest;
import UnitTest.Tests.ScrollingTest;
import UnitTest.Tests.TabTest;
@@ -72,6 +73,7 @@
public var undoRedoTest:UndoRedoTest;
public var textFlowEditTest:TextFlowEditTest;
public var tabTest:TabTest;
+ public var horizontalScrollingTest:HorizontalScrollingTest;
}
}
diff --git a/automation_tests/src/UnitTest/Helpers/ColumnBreak.as b/automation_tests/src/UnitTest/Helpers/ColumnBreak.as
new file mode 100644
index 0000000..5debc41
--- /dev/null
+++ b/automation_tests/src/UnitTest/Helpers/ColumnBreak.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Helpers
+{
+ import flash.display.Sprite;
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+
+ import flashx.textLayout.container.*;
+ import flashx.textLayout.elements.*;
+ import flashx.textLayout.formats.*;
+
+ [SWF(width="1200", height="400")]
+
+ public class ColumnBreak extends Sprite
+ {
+ public var textFlow:TextFlow = new TextFlow();
+
+ public function ColumnBreak(columnWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
+ {
+ /*
+ TextFlow.hostFormat -> textLayoutFormat
+ DivElement.format -> autoFmt
+ ListElement.format -> alwaysFmt
+ ListItemElement123.format -> inheritFmt
+ ParagraphElement123.format -> inheritFmt
+
+ TextFlow.addController -> Sprite123(container123)
+
+ TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123 -> span123 -> string123
+ */
+
+ var para1String:String = "STR1CBB " + textLayoutFmt1.columnBreakBefore
+ + "CBA " + textLayoutFmt1.columnBreakAfter;
+ var para2String:String = "STR2CBB " + textLayoutFmt2.columnBreakBefore
+ + "CBA " + textLayoutFmt2.columnBreakAfter;
+ var para3String:String = "STR3CBB " + textLayoutFmt3.columnBreakBefore
+ + "CBA " + textLayoutFmt3.columnBreakAfter;
+
+
+ var listElement:ListElement = new ListElement();
+ var listItemElement1:ListItemElement = new ListItemElement();
+ var listItemElement2:ListItemElement = new ListItemElement();
+ var listItemElement3:ListItemElement = new ListItemElement();
+
+ var paragraph1:ParagraphElement = new ParagraphElement();
+ var paragraph2:ParagraphElement = new ParagraphElement();
+ var paragraph3:ParagraphElement = new ParagraphElement();
+
+ var spanElement:SpanElement = new SpanElement();
+ spanElement.text = para1String;
+ paragraph1.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para2String;
+ paragraph2.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para3String;
+ paragraph3.addChild(spanElement);
+
+
+ listItemElement1.addChild(paragraph1);
+ listItemElement2.addChild(paragraph2);
+ listItemElement3.addChild(paragraph3);
+ listElement.addChild(listItemElement1);
+ listElement.addChild(listItemElement2);
+ listElement.addChild(listItemElement3);
+
+ textFlow.addChild(listElement);
+
+ var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
+ textLayoutFormat.fontSize = 12;
+ textLayoutFormat.textIndent = 10;
+ textLayoutFormat.paragraphSpaceAfter = 5;
+ textLayoutFormat.columnCount = 3;
+ textLayoutFormat.fontFamily = "Arial";
+ textFlow.hostFormat = textLayoutFormat;
+
+ paragraph1.format = textLayoutFmt1;
+ paragraph2.format = textLayoutFmt2;
+ paragraph3.format = textLayoutFmt3;
+
+ if (stage)
+ {
+ stage.align = StageAlign.TOP_LEFT;
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ }
+
+ var sprite1:Sprite = new Sprite();
+ var sprite2:Sprite = new Sprite();
+ var sprite3:Sprite = new Sprite();
+
+ addChild(sprite1);
+
+ textFlow.flowComposer.addController(new ContainerController(sprite1, columnWidth, columnWidth));
+ sprite1.graphics.beginFill(0xf0f0a0);
+ sprite1.graphics.drawRect(0, 0, columnWidth, columnWidth);
+ sprite1.graphics.endFill();
+ sprite1.x = 0;
+ sprite1.y = 0;
+
+ textFlow.flowComposer.updateAllControllers();
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Helpers/ColumnContainerBreak.as b/automation_tests/src/UnitTest/Helpers/ColumnContainerBreak.as
new file mode 100644
index 0000000..cadb565
--- /dev/null
+++ b/automation_tests/src/UnitTest/Helpers/ColumnContainerBreak.as
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Helpers
+{
+ import flash.display.Sprite;
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+
+ import flashx.textLayout.container.*;
+ import flashx.textLayout.elements.*;
+ import flashx.textLayout.formats.*;
+
+ [SWF(width="1200", height="500")]
+
+ public class ColumnContainerBreak extends Sprite
+ {
+ public var textFlow:TextFlow = new TextFlow();
+
+ public function ColumnContainerBreak(columnWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
+ {
+ /*
+ TextFlow.hostFormat -> textLayoutFormat
+ DivElement.format -> autoFmt
+ ListElement.format -> alwaysFmt
+ ListItemElement123.format -> inheritFmt
+ ParagraphElement123.format -> inheritFmt
+
+ TextFlow.addController -> Sprite123(container123)
+
+ TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123
+ */
+
+ var para1String:String = "STR1ColBB " + textLayoutFmt1.columnBreakBefore
+ + "ColBA " + textLayoutFmt1.columnBreakAfter
+ + "ConBB " + textLayoutFmt1.containerBreakBefore
+ + "ConBA " + textLayoutFmt1.containerBreakAfter;
+ var para2String:String = "STR2ColBB " + textLayoutFmt2.columnBreakBefore
+ + "ColBA " + textLayoutFmt2.columnBreakAfter
+ + "ConBB " + textLayoutFmt2.containerBreakBefore
+ + "ConBA " + textLayoutFmt2.containerBreakAfter;
+ var para3String:String = "STR3ColBB " + textLayoutFmt3.columnBreakBefore
+ + "ColBA " + textLayoutFmt3.columnBreakAfter
+ + "ConBB " + textLayoutFmt3.containerBreakBefore
+ + "ConBA " + textLayoutFmt3.containerBreakAfter;
+
+
+ var listElement:ListElement = new ListElement();
+ var listItemElement1:ListItemElement = new ListItemElement();
+ var listItemElement2:ListItemElement = new ListItemElement();
+ var listItemElement3:ListItemElement = new ListItemElement();
+
+ var paragraph1:ParagraphElement = new ParagraphElement();
+ var paragraph2:ParagraphElement = new ParagraphElement();
+ var paragraph3:ParagraphElement = new ParagraphElement();
+
+ var spanElement:SpanElement = new SpanElement();
+
+ spanElement.text = para1String;
+ paragraph1.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para2String;
+ paragraph2.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para3String;
+ paragraph3.addChild(spanElement);
+
+
+ listItemElement1.addChild(paragraph1);
+ listItemElement2.addChild(paragraph2);
+ listItemElement3.addChild(paragraph3);
+ listElement.addChild(listItemElement1);
+ listElement.addChild(listItemElement2);
+ listElement.addChild(listItemElement3);
+
+ textFlow.addChild(listElement);
+
+ var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
+ textLayoutFormat.fontSize = 12;
+ textLayoutFormat.textIndent = 10;
+ textLayoutFormat.paragraphSpaceAfter = 5;
+ textLayoutFormat.columnCount = 3;
+ textLayoutFormat.fontFamily = "Arial";
+ textFlow.hostFormat = textLayoutFormat;
+
+ paragraph1.format = textLayoutFmt1;
+ paragraph2.format = textLayoutFmt2;
+ paragraph3.format = textLayoutFmt3;
+
+ if (stage)
+ {
+ stage.align = StageAlign.TOP_LEFT;
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ }
+
+ var sprite1:Sprite = new Sprite();
+ var sprite2:Sprite = new Sprite();
+ var sprite3:Sprite = new Sprite();
+
+ addChild(sprite1);
+ addChild(sprite2);
+ addChild(sprite3);
+
+ textFlow.flowComposer.addController(new ContainerController(sprite1, columnWidth, columnWidth));
+ sprite1.graphics.beginFill(0xf0f0a0);
+ sprite1.graphics.drawRect(0, 0, columnWidth, columnWidth);
+ sprite1.graphics.endFill();
+ sprite1.x = 0;
+ sprite1.y = 0;
+
+ textFlow.flowComposer.addController(new ContainerController(sprite2, columnWidth, columnWidth));
+ sprite2.graphics.beginFill(0xa0d0f0);
+ sprite2.graphics.drawRect(0, 0, columnWidth, columnWidth);
+ sprite2.graphics.endFill();
+ sprite2.x = sprite1.x + sprite1.width;
+ sprite2.y = 0;
+
+ textFlow.flowComposer.addController(new ContainerController(sprite3, columnWidth, columnWidth));
+ sprite3.graphics.beginFill(0xf0d0d0);
+ sprite3.graphics.drawRect(0, 0, columnWidth, columnWidth);
+ sprite3.graphics.endFill();
+ sprite3.x = sprite2.x + sprite2.width;
+ sprite3.y = 0;
+
+ textFlow.flowComposer.updateAllControllers();
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Helpers/ContainerBreak.as b/automation_tests/src/UnitTest/Helpers/ContainerBreak.as
new file mode 100644
index 0000000..3b67114
--- /dev/null
+++ b/automation_tests/src/UnitTest/Helpers/ContainerBreak.as
@@ -0,0 +1,142 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Helpers
+{
+ import flash.display.Sprite;
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+
+ import flashx.textLayout.container.*;
+ import flashx.textLayout.elements.*;
+ import flashx.textLayout.formats.*;
+
+ [SWF(width="1200", height="400")]
+
+ public class ContainerBreak extends Sprite
+ {
+ public var textFlow:TextFlow = new TextFlow();
+
+ public function ContainerBreak(containerWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
+ {
+ /*
+ TextFlow.hostFormat -> textLayoutFormat
+ DivElement.format -> autoFmt
+ ListElement.format -> alwaysFmt
+ ListItemElement123.format -> inheritFmt
+ ParagraphElement123.format -> inheritFmt
+
+ TextFlow.addController -> Sprite123(container123)
+
+ TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123
+ */
+
+ var para1String:String = "STR1CBB " + textLayoutFmt1.containerBreakBefore
+ + "CBA " + textLayoutFmt1.containerBreakAfter;
+ var para2String:String = "STR2CBB " + textLayoutFmt2.containerBreakBefore
+ + "CBA " + textLayoutFmt2.containerBreakAfter;
+ var para3String:String = "STR3CBB " + textLayoutFmt3.containerBreakBefore
+ + "CBA " + textLayoutFmt3.containerBreakAfter;
+
+
+ var listElement:ListElement = new ListElement();
+ var listItemElement1:ListItemElement = new ListItemElement();
+ var listItemElement2:ListItemElement = new ListItemElement();
+ var listItemElement3:ListItemElement = new ListItemElement();
+
+ var paragraph1:ParagraphElement = new ParagraphElement();
+ var paragraph2:ParagraphElement = new ParagraphElement();
+ var paragraph3:ParagraphElement = new ParagraphElement();
+
+ var spanElement:SpanElement = new SpanElement();
+
+ spanElement.text = para1String;
+ // add spans to first paragraph
+ paragraph1.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para2String;
+ paragraph2.addChild(spanElement);
+
+ spanElement = new SpanElement();
+ spanElement.text = para3String;
+ paragraph3.addChild(spanElement);
+
+ listItemElement1.addChild(paragraph1);
+ listItemElement2.addChild(paragraph2);
+ listItemElement3.addChild(paragraph3);
+ listElement.addChild(listItemElement1);
+ listElement.addChild(listItemElement2);
+ listElement.addChild(listItemElement3);
+
+ textFlow.addChild(listElement);
+
+ var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
+ textLayoutFormat.fontSize = 12;
+ textLayoutFormat.textIndent = 10;
+ textLayoutFormat.paragraphSpaceAfter = 5;
+ textLayoutFormat.columnCount = 1;
+ textLayoutFormat.columnWidth = containerWidth;
+ textLayoutFormat.fontFamily = "Arial";
+ textLayoutFormat.columnGap = 0;
+ textFlow.hostFormat = textLayoutFormat;
+
+ paragraph1.format = textLayoutFmt1;
+ paragraph2.format = textLayoutFmt2;
+ paragraph3.format = textLayoutFmt3;
+
+ if (stage)
+ {
+ stage.align = StageAlign.TOP_LEFT;
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ }
+
+ var sprite1:Sprite = new Sprite();
+ var sprite2:Sprite = new Sprite();
+ var sprite3:Sprite = new Sprite();
+
+ addChild(sprite1);
+ addChild(sprite2);
+ addChild(sprite3);
+
+ textFlow.flowComposer.addController(new ContainerController(sprite1, containerWidth, containerWidth));
+ sprite1.graphics.beginFill(0xf0f0a0);
+ sprite1.graphics.drawRect(0, 0, containerWidth, containerWidth);
+ sprite1.graphics.endFill();
+ sprite1.x = 0;
+ sprite1.y = 0;
+
+ textFlow.flowComposer.addController(new ContainerController(sprite2, containerWidth, containerWidth));
+ sprite2.graphics.beginFill(0xa0d0f0);
+ sprite2.graphics.drawRect(0, 0, containerWidth, containerWidth);
+ sprite2.graphics.endFill();
+ sprite2.x = sprite1.x + sprite1.width;
+ sprite2.y = 0;
+
+ textFlow.flowComposer.addController(new ContainerController(sprite3, containerWidth, containerWidth));
+ sprite3.graphics.beginFill(0xf0d0d0);
+ sprite3.graphics.drawRect(0, 0, containerWidth, containerWidth);
+ sprite3.graphics.endFill();
+ sprite3.x = sprite2.x + sprite2.width;
+ sprite3.y = 0;
+
+ textFlow.flowComposer.updateAllControllers();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Tests/ColumnBreak.as b/automation_tests/src/UnitTest/Tests/ColumnBreak.as
deleted file mode 100644
index 560669d..0000000
--- a/automation_tests/src/UnitTest/Tests/ColumnBreak.as
+++ /dev/null
@@ -1,129 +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 flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
-
- import flashx.textLayout.container.*;
- import flashx.textLayout.elements.*;
- import flashx.textLayout.elements.SpanElement;
- import flashx.textLayout.events.TextLayoutEvent;
- import flashx.textLayout.formats.*;
- import flashx.textLayout.formats.BreakStyle;
-
-
- [SWF(width="1200", height="400")]
-
- public class ColumnBreak extends Sprite
- {
- public var textFlow:TextFlow = new TextFlow();
-
- public function ColumnBreak(columnWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
- {
- /*
- TextFlow.hostFormat -> textLayoutFormat
- DivElement.format -> autoFmt
- ListElement.format -> alwaysFmt
- ListItemElement123.format -> inheritFmt
- ParagraphElement123.format -> inheritFmt
-
- TextFlow.addController -> Sprite123(container123)
-
- TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123 -> span123 -> string123
- */
-
- var para1String:String = "STR1CBB " + textLayoutFmt1.columnBreakBefore
- + "CBA " + textLayoutFmt1.columnBreakAfter;
- var para2String:String = "STR2CBB " + textLayoutFmt2.columnBreakBefore
- + "CBA " + textLayoutFmt2.columnBreakAfter;
- var para3String:String = "STR3CBB " + textLayoutFmt3.columnBreakBefore
- + "CBA " + textLayoutFmt3.columnBreakAfter;
-
-
- var listElement:ListElement = new ListElement() ;
- var listItemElement1:ListItemElement = new ListItemElement() ;
- var listItemElement2:ListItemElement = new ListItemElement() ;
- var listItemElement3:ListItemElement = new ListItemElement() ;
-
- var paragraph1:ParagraphElement = new ParagraphElement();
- var paragraph2:ParagraphElement = new ParagraphElement();
- var paragraph3:ParagraphElement = new ParagraphElement();
-
- var spanElement:SpanElement = new SpanElement();
- spanElement.text = para1String;
- paragraph1.addChild(spanElement);
-
- spanElement = new SpanElement() ;
- spanElement.text = para2String;
- paragraph2.addChild(spanElement) ;
-
- spanElement = new SpanElement() ;
- spanElement.text = para3String ;
- paragraph3.addChild(spanElement) ;
-
-
- listItemElement1.addChild(paragraph1) ;
- listItemElement2.addChild(paragraph2) ;
- listItemElement3.addChild(paragraph3) ;
- listElement.addChild(listItemElement1) ;
- listElement.addChild(listItemElement2) ;
- listElement.addChild(listItemElement3) ;
-
- textFlow.addChild(listElement) ;
-
- var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
- textLayoutFormat.fontSize = 12;
- textLayoutFormat.textIndent = 10;
- textLayoutFormat.paragraphSpaceAfter = 5;
- textLayoutFormat.columnCount = 3 ;
- textLayoutFormat.fontFamily="Arial" ;
- textFlow.hostFormat = textLayoutFormat;
-
- paragraph1.format = textLayoutFmt1 ;
- paragraph2.format = textLayoutFmt2 ;
- paragraph3.format = textLayoutFmt3 ;
-
- if (stage)
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- }
-
- var sprite1:Sprite = new Sprite() ;
- var sprite2:Sprite = new Sprite() ;
- var sprite3:Sprite = new Sprite() ;
-
- addChild(sprite1) ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite1, columnWidth, columnWidth) );
- sprite1.graphics.beginFill(0xf0f0a0) ;
- sprite1.graphics.drawRect(0, 0, columnWidth, columnWidth) ;
- sprite1.graphics.endFill() ;
- sprite1.x = 0 ;
- sprite1.y = 0 ;
-
- textFlow.flowComposer.updateAllControllers() ;
-
- }
-
- }
-}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Tests/ColumnContainerBreak.as b/automation_tests/src/UnitTest/Tests/ColumnContainerBreak.as
deleted file mode 100644
index 3ad3ef0..0000000
--- a/automation_tests/src/UnitTest/Tests/ColumnContainerBreak.as
+++ /dev/null
@@ -1,153 +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 flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
-
- import flashx.textLayout.container.*;
- import flashx.textLayout.elements.*;
- import flashx.textLayout.elements.SpanElement;
- import flashx.textLayout.events.TextLayoutEvent;
- import flashx.textLayout.formats.*;
- import flashx.textLayout.formats.BreakStyle;
-
-
- [SWF(width="1200", height="500")]
-
- public class ColumnContainerBreak extends Sprite
- {
- public var textFlow:TextFlow = new TextFlow();
-
- public function ColumnContainerBreak(columnWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
- {
- /*
- TextFlow.hostFormat -> textLayoutFormat
- DivElement.format -> autoFmt
- ListElement.format -> alwaysFmt
- ListItemElement123.format -> inheritFmt
- ParagraphElement123.format -> inheritFmt
-
- TextFlow.addController -> Sprite123(container123)
-
- TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123
- */
-
- var para1String:String = "STR1ColBB " + textLayoutFmt1.columnBreakBefore
- + "ColBA " + textLayoutFmt1.columnBreakAfter
- + "ConBB " + textLayoutFmt1.containerBreakBefore
- + "ConBA " + textLayoutFmt1.containerBreakAfter;
- var para2String:String = "STR2ColBB " + textLayoutFmt2.columnBreakBefore
- + "ColBA " + textLayoutFmt2.columnBreakAfter
- + "ConBB " + textLayoutFmt2.containerBreakBefore
- + "ConBA " + textLayoutFmt2.containerBreakAfter;
- var para3String:String = "STR3ColBB " + textLayoutFmt3.columnBreakBefore
- + "ColBA " + textLayoutFmt3.columnBreakAfter
- + "ConBB " + textLayoutFmt3.containerBreakBefore
- + "ConBA " + textLayoutFmt3.containerBreakAfter;
-
-
- var listElement:ListElement = new ListElement() ;
- var listItemElement1:ListItemElement = new ListItemElement() ;
- var listItemElement2:ListItemElement = new ListItemElement() ;
- var listItemElement3:ListItemElement = new ListItemElement() ;
-
- var paragraph1:ParagraphElement = new ParagraphElement();
- var paragraph2:ParagraphElement = new ParagraphElement();
- var paragraph3:ParagraphElement = new ParagraphElement();
-
- var spanElement:SpanElement = new SpanElement();
-
- spanElement.text = para1String;
- paragraph1.addChild(spanElement);
-
- spanElement = new SpanElement() ;
- spanElement.text = para2String;
- paragraph2.addChild(spanElement) ;
-
- spanElement = new SpanElement() ;
- spanElement.text = para3String ;
- paragraph3.addChild(spanElement) ;
-
-
- listItemElement1.addChild(paragraph1) ;
- listItemElement2.addChild(paragraph2) ;
- listItemElement3.addChild(paragraph3) ;
- listElement.addChild(listItemElement1) ;
- listElement.addChild(listItemElement2) ;
- listElement.addChild(listItemElement3) ;
-
- textFlow.addChild(listElement) ;
-
- var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
- textLayoutFormat.fontSize = 12;
- textLayoutFormat.textIndent = 10;
- textLayoutFormat.paragraphSpaceAfter = 5;
- textLayoutFormat.columnCount = 3 ;
- textLayoutFormat.fontFamily="Arial" ;
- textFlow.hostFormat = textLayoutFormat;
-
- paragraph1.format = textLayoutFmt1 ;
- paragraph2.format = textLayoutFmt2 ;
- paragraph3.format = textLayoutFmt3 ;
-
- if (stage)
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- }
-
- var sprite1:Sprite = new Sprite() ;
- var sprite2:Sprite = new Sprite() ;
- var sprite3:Sprite = new Sprite() ;
-
- addChild(sprite1) ;
- addChild(sprite2) ;
- addChild(sprite3) ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite1, columnWidth, columnWidth)) ;
- sprite1.graphics.beginFill(0xf0f0a0) ;
- sprite1.graphics.drawRect(0, 0, columnWidth, columnWidth) ;
- sprite1.graphics.endFill() ;
- sprite1.x = 0 ;
- sprite1.y = 0 ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite2, columnWidth, columnWidth)) ;
- sprite2.graphics.beginFill(0xa0d0f0) ;
- sprite2.graphics.drawRect(0, 0, columnWidth, columnWidth) ;
- sprite2.graphics.endFill() ;
- sprite2.x = sprite1.x + sprite1.width ;
- sprite2.y = 0 ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite3, columnWidth, columnWidth)) ;
- sprite3.graphics.beginFill(0xf0d0d0) ;
- sprite3.graphics.drawRect(0, 0, columnWidth, columnWidth) ;
- sprite3.graphics.endFill() ;
- sprite3.x = sprite2.x + sprite2.width ;
- sprite3.y = 0 ;
-
- textFlow.flowComposer.updateAllControllers() ;
-
- }
-
-
- }
-}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as b/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
index 30e2a39..bfd1916 100644
--- a/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
+++ b/automation_tests/src/UnitTest/Tests/ContainerAttributeTest.as
@@ -22,6 +22,9 @@
import UnitTest.ExtendedClasses.VellumTestCase;
import UnitTest.Fixtures.TestCaseVo;
import UnitTest.Fixtures.TestConfig;
+ import UnitTest.Helpers.ColumnBreak;
+ import UnitTest.Helpers.ColumnContainerBreak;
+ import UnitTest.Helpers.ContainerBreak;
import flash.display.BitmapData;
import flash.display.DisplayObject;
diff --git a/automation_tests/src/UnitTest/Tests/ContainerBreak.as b/automation_tests/src/UnitTest/Tests/ContainerBreak.as
deleted file mode 100644
index 833be71..0000000
--- a/automation_tests/src/UnitTest/Tests/ContainerBreak.as
+++ /dev/null
@@ -1,147 +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 flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
-
- import flashx.textLayout.container.*;
- import flashx.textLayout.elements.*;
- import flashx.textLayout.elements.SpanElement;
- import flashx.textLayout.events.TextLayoutEvent;
- import flashx.textLayout.formats.*;
- import flashx.textLayout.formats.BreakStyle;
-
-
- [SWF(width="1200", height="400")]
-
- public class ContainerBreak extends Sprite
- {
- public var textFlow:TextFlow = new TextFlow();
-
- public function ContainerBreak(containerWidth:int, textLayoutFmt1:TextLayoutFormat, textLayoutFmt2:TextLayoutFormat, textLayoutFmt3:TextLayoutFormat)
- {
- /*
- TextFlow.hostFormat -> textLayoutFormat
- DivElement.format -> autoFmt
- ListElement.format -> alwaysFmt
- ListItemElement123.format -> inheritFmt
- ParagraphElement123.format -> inheritFmt
-
- TextFlow.addController -> Sprite123(container123)
-
- TextFlow -> ListElement -> ListItemElement123 -> ParagraphElement123
- */
-
- var para1String:String = "STR1CBB " + textLayoutFmt1.containerBreakBefore
- + "CBA " + textLayoutFmt1.containerBreakAfter;
- var para2String:String = "STR2CBB " + textLayoutFmt2.containerBreakBefore
- + "CBA " + textLayoutFmt2.containerBreakAfter;
- var para3String:String = "STR3CBB " + textLayoutFmt3.containerBreakBefore
- + "CBA " + textLayoutFmt3.containerBreakAfter;
-
-
- var listElement:ListElement = new ListElement() ;
- var listItemElement1:ListItemElement = new ListItemElement() ;
- var listItemElement2:ListItemElement = new ListItemElement() ;
- var listItemElement3:ListItemElement = new ListItemElement() ;
-
- var paragraph1:ParagraphElement = new ParagraphElement();
- var paragraph2:ParagraphElement = new ParagraphElement();
- var paragraph3:ParagraphElement = new ParagraphElement();
-
- var spanElement:SpanElement = new SpanElement();
-
- spanElement.text = para1String;
- // add spans to first paragraph
- paragraph1.addChild(spanElement);
-
- spanElement = new SpanElement() ;
- spanElement.text = para2String;
- paragraph2.addChild(spanElement) ;
-
- spanElement = new SpanElement() ;
- spanElement.text = para3String ;
- paragraph3.addChild(spanElement) ;
-
- listItemElement1.addChild(paragraph1) ;
- listItemElement2.addChild(paragraph2) ;
- listItemElement3.addChild(paragraph3) ;
- listElement.addChild(listItemElement1) ;
- listElement.addChild(listItemElement2) ;
- listElement.addChild(listItemElement3) ;
-
- textFlow.addChild(listElement) ;
-
- var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
- textLayoutFormat.fontSize = 12;
- textLayoutFormat.textIndent = 10;
- textLayoutFormat.paragraphSpaceAfter = 5;
- textLayoutFormat.columnCount = 1 ;
- textLayoutFormat.columnWidth = containerWidth;
- textLayoutFormat.fontFamily="Arial" ;
- textLayoutFormat.columnGap = 0;
- textFlow.hostFormat = textLayoutFormat;
-
- paragraph1.format = textLayoutFmt1 ;
- paragraph2.format = textLayoutFmt2 ;
- paragraph3.format = textLayoutFmt3 ;
-
- if (stage)
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- }
-
- var sprite1:Sprite = new Sprite() ;
- var sprite2:Sprite = new Sprite() ;
- var sprite3:Sprite = new Sprite() ;
-
- addChild(sprite1) ;
- addChild(sprite2) ;
- addChild(sprite3) ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite1, containerWidth, containerWidth)) ;
- sprite1.graphics.beginFill(0xf0f0a0) ;
- sprite1.graphics.drawRect(0, 0, containerWidth, containerWidth) ;
- sprite1.graphics.endFill() ;
- sprite1.x = 0 ;
- sprite1.y = 0 ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite2, containerWidth, containerWidth)) ;
- sprite2.graphics.beginFill(0xa0d0f0) ;
- sprite2.graphics.drawRect(0, 0, containerWidth, containerWidth) ;
- sprite2.graphics.endFill() ;
- sprite2.x = sprite1.x + sprite1.width ;
- sprite2.y = 0 ;
-
- textFlow.flowComposer.addController(new ContainerController(sprite3, containerWidth, containerWidth)) ;
- sprite3.graphics.beginFill(0xf0d0d0) ;
- sprite3.graphics.drawRect(0, 0, containerWidth, containerWidth) ;
- sprite3.graphics.endFill() ;
- sprite3.x = sprite2.x + sprite2.width ;
- sprite3.y = 0 ;
-
- textFlow.flowComposer.updateAllControllers() ;
-
- }
- }
-}
\ No newline at end of file
diff --git a/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as b/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
index 1ea08ae..9d94d66 100644
--- a/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
+++ b/automation_tests/src/UnitTest/Tests/HorizontalScrollingTest.as
@@ -18,826 +18,1007 @@
////////////////////////////////////////////////////////////////////////////////
package UnitTest.Tests
{
- import UnitTest.ExtendedClasses.TestSuiteExtended;
- import UnitTest.ExtendedClasses.VellumTestCase;
- import UnitTest.Fixtures.FileRepository;
- import UnitTest.Fixtures.TestConfig;
+ import UnitTest.ExtendedClasses.TestConfigurationLoader;
+ import UnitTest.ExtendedClasses.VellumTestCase;
+ import UnitTest.Fixtures.TestCaseVo;
+ import UnitTest.Fixtures.TestConfig;
- import flash.events.KeyboardEvent;
- import flash.ui.KeyLocation;
+ import flash.events.KeyboardEvent;
+ import flash.ui.KeyLocation;
- import flashx.textLayout.formats.BlockProgression;
- import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.formats.BlockProgression;
import org.flexunit.asserts.assertTrue;
-
+ [TestCase(order=25)]
+ [RunWith("org.flexunit.runners.Parameterized")]
public class HorizontalScrollingTest extends VellumTestCase
- {
- // List of available keyboard gestures
- // Note that on Mac: CTRL == COMMAND
- // and: ALT == OPTION
- // These are directly mapped in flash player
- private static const CTRL_BACKSPACE:int = 100;
- private static const CTRL_DELETE:int = 101;
- private static const OPT_BACKSPACE:int = 102;
- private static const OPT_DELETE:int = 103;
- private static const CTRL_LEFT:int = 104;
- private static const CTRL_RIGHT:int = 105;
- private static const CTRL_UP:int = 106;
- private static const CTRL_DOWN:int = 107;
- private static const OPT_LEFT:int = 108;
- private static const OPT_RIGHT:int = 109;
- private static const OPT_UP:int = 110;
- private static const OPT_DOWN:int = 111;
- private static const SHIFT_CTRL_LEFT:int = 112;
- private static const SHIFT_CTRL_RIGHT:int = 113;
- private static const SHIFT_CTRL_UP:int = 114;
- private static const SHIFT_CTRL_DOWN:int = 115;
- private static const SHIFT_OPT_LEFT:int = 116;
- private static const SHIFT_OPT_RIGHT:int = 117;
- private static const SHIFT_OPT_UP:int = 118;
- private static const SHIFT_OPT_DOWN:int = 119;
- private static const HOME:int = 120;
- private static const END:int = 121;
- private static const SHIFT_HOME:int = 122;
- private static const SHIFT_END:int = 123;
- private static const CTRL_HOME:int = 124;
- private static const CTRL_END:int = 125;
- private static const SHIFT_CTRL_HOME:int = 126;
- private static const SHIFT_CTRL_END:int = 127;
- private static const PG_UP:int = 128;
- private static const PG_DOWN:int = 129;
- private static const SHIFT_PG_UP:int = 130;
- private static const SHIFT_PG_DOWN:int = 131;
- private static const UP:int = 132;
- private static const DOWN:int = 133;
- private static const LEFT:int = 134;
- private static const RIGHT:int = 135;
+ {
- private static const SHIFT_RIGHT:int = 136;
- private static const SHIFT_LEFT:int = 137;
+ // List of available keyboard gestures
+ // Note that on Mac: CTRL == COMMAND
+ // and: ALT == OPTION
+ // These are directly mapped in flash player
+ private static const CTRL_BACKSPACE:int = 100;
+ private static const CTRL_DELETE:int = 101;
+ private static const OPT_BACKSPACE:int = 102;
+ private static const OPT_DELETE:int = 103;
+ private static const CTRL_LEFT:int = 104;
+ private static const CTRL_RIGHT:int = 105;
+ private static const CTRL_UP:int = 106;
+ private static const CTRL_DOWN:int = 107;
+ private static const OPT_LEFT:int = 108;
+ private static const OPT_RIGHT:int = 109;
+ private static const OPT_UP:int = 110;
+ private static const OPT_DOWN:int = 111;
+ private static const SHIFT_CTRL_LEFT:int = 112;
+ private static const SHIFT_CTRL_RIGHT:int = 113;
+ private static const SHIFT_CTRL_UP:int = 114;
+ private static const SHIFT_CTRL_DOWN:int = 115;
+ private static const SHIFT_OPT_LEFT:int = 116;
+ private static const SHIFT_OPT_RIGHT:int = 117;
+ private static const SHIFT_OPT_UP:int = 118;
+ private static const SHIFT_OPT_DOWN:int = 119;
+ private static const HOME:int = 120;
+ private static const END:int = 121;
+ private static const SHIFT_HOME:int = 122;
+ private static const SHIFT_END:int = 123;
+ private static const CTRL_HOME:int = 124;
+ private static const CTRL_END:int = 125;
+ private static const SHIFT_CTRL_HOME:int = 126;
+ private static const SHIFT_CTRL_END:int = 127;
+ private static const PG_UP:int = 128;
+ private static const PG_DOWN:int = 129;
+ private static const SHIFT_PG_UP:int = 130;
+ private static const SHIFT_PG_DOWN:int = 131;
+ private static const UP:int = 132;
+ private static const DOWN:int = 133;
+ private static const LEFT:int = 134;
+ private static const RIGHT:int = 135;
- public function HorizontalScrollingTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
- {
- super(methodName, testID, testConfig, testCaseXML);
+ private static const SHIFT_RIGHT:int = 136;
+ private static const SHIFT_LEFT:int = 137;
- // Note: These must correspond to a Watson product area (case-sensitive)
- metaData.productArea = "UI";
- metaData.productSubArea = "Scrolling";
- }
+ [DataPoints(loader=HOLTRTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var HOLTRTestDp:Array;
- public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- {
- FileRepository.readFile(testConfig.baseURL,"../../test/testFiles/markup/tlf/HORLTRHARD.xml");
- FileRepository.readFile(testConfig.baseURL,"../../test/testFiles/markup/tlf/VORLTRHARD.xml");
- FileRepository.readFile(testConfig.baseURL,"../../test/testFiles/markup/tlf/HORRTLHARD.xml");
- FileRepository.readFile(testConfig.baseURL,"../../test/testFiles/markup/tlf/VORRTLHARD.xml");
- var testCaseClass:Class = HorizontalScrollingTest;
- VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- }
+ public static var HOLTRTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/HorizontalScrollingTests.xml", "HOLTR_endKeyScrollingTest");
- public override function setUpTest():void
- {
- // Booga - Need to load up the test file here.
+ [DataPoints(loader=HORTLTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var HORTLTestDp:Array;
- super.setUpTest();
- }
+ public static var HORTLTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/HorizontalScrollingTests.xml", "HORTL_backspaceScrollingTest");
- public override function tearDownTest():void
- {
- // Restore default configurations
- super.tearDownTest();
- }
+ [DataPoints(loader=VOLTRTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var VOLTRTestDp:Array;
+ public static var VOLTRTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/HorizontalScrollingTests.xml", "VOLTR_endKeyScrollingTest");
- // Send a keyboard gesture using values listed above
- // Code folding extremely recommended here
- private function sendKeyboardGesture( type:int ): void
- {
- var charCode:int;
- var keyCode:int;
- var ctrlDown:Boolean = false;
- var shiftDown:Boolean = false;
- var altDown:Boolean = false;
+ [DataPoints(loader=VORTLTestLoader)]
+ [ArrayElementType("UnitTest.Fixtures.TestCaseVo")]
+ public static var VORTLDp:Array;
- var leftCode:int = 37;
- var rightCode:int = 39;
- var upCode:int = 38;
- var downCode:int = 40;
+ public static var VORTLTestLoader:TestConfigurationLoader = new TestConfigurationLoader("../../test/testCases/HorizontalScrollingTests.xml", "VORTL_backspaceScrollingTest");
- // Arrow keys behave differently on Right to Left Blockprogression
- // For the sake of test simplicity, I am translating the directions here
- if( SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL )
- {
- leftCode = 38;
- rightCode = 40;
- upCode = 39;
- downCode = 37;
- }
- switch( type )
- {
- case CTRL_BACKSPACE:
- charCode = 8;
- keyCode = 8;
- ctrlDown = true;
- break;
- case CTRL_DELETE:
- charCode = 127;
- keyCode = 46;
- ctrlDown = true;
- break;
- case OPT_BACKSPACE:
- charCode = 8;
- keyCode = 8;
- altDown = true;
- break;
- case OPT_DELETE:
- charCode = 127;
- keyCode = 46;
- altDown = true;
- break;
- case CTRL_LEFT:
- charCode = 0;
- keyCode = leftCode;
- ctrlDown = true;
- break;
- case CTRL_RIGHT:
- charCode = 0;
- keyCode = rightCode;
- ctrlDown = true;
- break;
- case CTRL_UP:
- charCode = 0;
- keyCode = upCode;
- ctrlDown = true;
- break;
- case CTRL_DOWN:
- charCode = 0;
- keyCode = downCode;
- ctrlDown = true;
- break;
- case OPT_LEFT:
- charCode = 0;
- keyCode = leftCode;
- altDown = true;
- break;
- case OPT_RIGHT:
- charCode = 0;
- keyCode = rightCode;
- altDown = true;
- break;
- case OPT_UP:
- charCode = 0;
- keyCode = upCode;
- altDown = true;
- break;
- case OPT_DOWN:
- charCode = 0;
- keyCode = downCode;
- altDown = true;
- break;
- case SHIFT_LEFT:
- charCode = 0;
- keyCode = leftCode;
- ctrlDown = false;
- shiftDown = true;
- break;
- case SHIFT_RIGHT:
- charCode = 0;
- keyCode = rightCode;
- ctrlDown = false;
- shiftDown = true;
- break;
- case SHIFT_CTRL_LEFT:
- charCode = 0;
- keyCode = leftCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_CTRL_RIGHT:
- charCode = 0;
- keyCode = rightCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_CTRL_UP:
- charCode = 0;
- keyCode = upCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_CTRL_DOWN:
- charCode = 0;
- keyCode = downCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_OPT_LEFT:
- charCode = 0;
- keyCode = leftCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_OPT_RIGHT:
- charCode = 0;
- keyCode = rightCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_OPT_UP:
- charCode = 0;
- keyCode = upCode;
- ctrlDown = true;
- shiftDown = true;
- break;
- case SHIFT_OPT_DOWN:
- charCode = 0;
- keyCode = downCode;
- altDown = true;
- shiftDown = true;
- break;
- case HOME:
- charCode = 0;
- keyCode = 36;
- break;
- case END:
- charCode = 0;
- keyCode = 35;
- break;
- case SHIFT_HOME:
- charCode = 0;
- keyCode = 36;
- shiftDown = true;
- break;
- case SHIFT_END:
- charCode = 0;
- keyCode = 35;
- shiftDown = true;
- break;
- case CTRL_HOME:
- charCode = 0;
- keyCode = 36;
- ctrlDown = true;
- break;
- case CTRL_END:
- charCode = 0;
- keyCode = 35;
- ctrlDown = true;
- break;
- case SHIFT_CTRL_HOME:
- charCode = 0;
- keyCode = 36;
- shiftDown = true;
- ctrlDown = true;
- break;
- case SHIFT_CTRL_END:
- charCode = 0;
- keyCode = 35;
- shiftDown = true;
- ctrlDown = true;
- break;
- case PG_UP:
- charCode = 0;
- keyCode = 33;
- break;
- case PG_DOWN:
- charCode = 0;
- keyCode = 34;
- break;
- case SHIFT_PG_UP:
- charCode = 0;
- keyCode = 33;
- shiftDown = true;
- break;
- case SHIFT_PG_DOWN:
- charCode = 0;
- keyCode = 34;
- shiftDown = true;
- break;
- case UP:
- charCode = 0;
- keyCode = upCode;
- break;
- case DOWN:
- charCode = 0;
- keyCode = downCode;
- break;
- case LEFT:
- charCode = 0;
- keyCode = leftCode;
- break;
- case RIGHT:
- charCode = 0;
- keyCode = rightCode;
- break;
- default:
- return;
- }
+ public function HorizontalScrollingTest()
+ {
+ super("", "TabTest", TestConfig.getInstance());
- var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN,
- true, false, charCode, keyCode, KeyLocation.STANDARD, ctrlDown, altDown, shiftDown);
- TestFrame.container["dispatchEvent"](kEvent);
- }
+ metaData = {};
+ // Note: These must correspond to a Watson product area (case-sensitive)
+ metaData.productArea = "UI";
+ metaData.productSubArea = "Scrolling";
+ }
- public function endKeyScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("endKeyScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("endKeyScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "endKeyScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "endKeyScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
+ [After]
+ public override function tearDownTest():void
+ {
+ // Restore default configurations
+ super.tearDownTest();
+ }
- }
+ // Horizontal Orientation Left To Right Direction Scrolling Tests.
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_endKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function homeKeyScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Hit the Home key to scroll to the end of the first line.
- sendKeyboardGesture( HOME );
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("homeKeyScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("homeKeyScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "homeKeyScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "homeKeyScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ endKeyScrollingTest(19977);
+ }
- public function cursorRightScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Hit the Home key to scroll to the end of the first line.
- sendKeyboardGesture( HOME );
- // Move the cursor over to the right.
- for (var i:Number = 0; i < 37; i++)
- {
- sendKeyboardGesture( RIGHT );
- }
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("cursorRightScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("cursorRightScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "cursorRightScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "cursorRightScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_homeKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function cursorLeftScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Move the cursor over to the right.
- for (var i:Number = 0; i < 41; i++)
- {
- sendKeyboardGesture( LEFT );
- }
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("cursorLeftScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("cursorLeftScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "cursorLeftScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "cursorLeftScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ homeKeyScrollingTest(19);
+ }
- public function dragRightScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Hit the Home key to scroll to the end of the first line.
- sendKeyboardGesture( HOME );
- // Move the cursor to the selection that will cause a drag.
- // Move the cursor over to the right.
- for (var i:Number = 0; i < 36; i++)
- {
- sendKeyboardGesture( RIGHT );
- }
- sendKeyboardGesture( SHIFT_RIGHT );
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("dragRightScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("dragRightScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "dragRightScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "dragRightScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_cursorRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function dragLeftScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Move the cursor to the selection that will cause a drag.
- // Move the cursor over to the right.
- for (var i:Number = 0; i < 40; i++)
- {
- sendKeyboardGesture( LEFT );
- }
- sendKeyboardGesture( SHIFT_LEFT );
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("dragLeftScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("dragLeftScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "dragLeftScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "dragLeftScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ cursorRightScrollingTest(29);
+ }
- public function characterEntryEndOfFirstLineScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Type in ABC and confirm that it scrolls.
- SelManager.insertText(" ABC");
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("characterEntryEndOfFirstLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("characterEntryEndOfFirstLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "characterEntryEndOfFirstLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "characterEntryEndOfFirstLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_cursorLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function characterEntryEndOfLastLineScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the CTRL+End key to scroll to the end of the last line.
- sendKeyboardGesture( CTRL_END );
- // Type in ABC and confirm that it scrolls.
- SelManager.insertText(" ABC");
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("characterEntryEndOfLastLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("characterEntryEndOfLastLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "characterEntryEndOfLastLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "characterEntryEndOfLastLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ cursorLeftScrollingTest(19960);
+ }
- public function spaceEntryEndOfFirstLineScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Type in ABC and confirm that it scrolls.
- SelManager.insertText(" ");
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("spaceEntryEndOfFirstLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("spaceEntryEndOfFirstLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "spaceEntryEndOfFirstLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "spaceEntryEndOfFirstLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_dragRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function spaceEntryEndOfLastLineScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the CTRL+End key to scroll to the end of the last line.
- sendKeyboardGesture( CTRL_END );
- // Type in ABC and confirm that it scrolls.
- SelManager.insertText(" ");
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("spaceEntryEndOfLastLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("spaceEntryEndOfLastLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "spaceEntryEndOfLastLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "spaceEntryEndOfLastLineScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ dragRightScrollingTest(29);
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_dragLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ dragLeftScrollingTest(19960);
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_characterEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ characterEntryEndOfFirstLineScrollingTest(19977)
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_characterEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ characterEntryEndOfLastLineScrollingTest(25178);
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_spaceEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ spaceEntryEndOfFirstLineScrollingTest(19977);
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_spaceEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ spaceEntryEndOfLastLineScrollingTest(25178);
+ }
+
+ [Test(dataProvider=HOLTRTestDp)]
+ public function HOLTR_backspaceScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ backspaceScrollingTest(19936);
+ }
+
+ // Vertical Orientation Left To Right Direction Scrolling Tests.
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_endKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ endKeyScrollingTest(20326);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_homeKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ homeKeyScrollingTest(19);
+ }
+
+ public function VOLTR_cursorRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ cursorRightScrollingTest(378);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_cursorLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ cursorLeftScrollingTest(19960);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_dragRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ dragRightScrollingTest(378);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_dragLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ dragLeftScrollingTest(19960);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_characterEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ characterEntryEndOfFirstLineScrollingTest(20326)
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_characterEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ characterEntryEndOfLastLineScrollingTest(25527);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_spaceEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ spaceEntryEndOfFirstLineScrollingTest(20326);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_spaceEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ spaceEntryEndOfLastLineScrollingTest(25527);
+ }
+
+ [Test(dataProvider=VOLTRTestDp)]
+ public function VOLTR_backspaceScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ backspaceScrollingTest(19936);
+ }
+
+
+ // Horizontal Orientation Left To Right Direction Scrolling Tests.
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_endKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ endKeyScrollingTest(19977);
+ }
+
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_homeKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ homeKeyScrollingTest(19);
+ }
+
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_cursorRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ cursorRightScrollingTest(29);
+ }
+
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_cursorLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ cursorLeftScrollingTest(19960);
+ }
+
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_dragRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+
+ dragRightScrollingTest(29);
+ }
- public function backspaceScrollingTest(scrollPos:Number):void
- {
- // Success or failure will be determined by the bitmap snapshot.
- // Move the cursor to the beginning of the first line.
- SelManager.selectRange(0,0);
- // Hit the End key to scroll to the end of the first line.
- sendKeyboardGesture( END );
- // Move the cursor to the selection that will cause a drag.
- // Move the cursor over to the right.
- for (var i:Number = 0; i < 40; i++)
- {
- sendKeyboardGesture( LEFT );
- }
- for(i = 0; i < 3; i++)
- {
- SelManager.deletePreviousCharacter();
- }
- var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
- // trace("backspaceScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
- // trace("backspaceScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
- if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
- {
- assertTrue( "backspaceScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
- }
- else
- {
- assertTrue( "backspaceScrollingTest Test Failed.",(scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
- }
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_dragLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- // Horizontal Orientation Left To Right Direction Scrolling Tests.
+ dragLeftScrollingTest(19960);
+ }
- public function HOLTR_endKeyScrollingTest():void
- {
- endKeyScrollingTest(19977);
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_characterEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HOLTR_homeKeyScrollingTest():void
- {
- homeKeyScrollingTest(19);
- }
+ characterEntryEndOfFirstLineScrollingTest(19977)
+ }
- public function HOLTR_cursorRightScrollingTest():void
- {
- cursorRightScrollingTest(29);
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_characterEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HOLTR_cursorLeftScrollingTest():void
- {
- cursorLeftScrollingTest(19960);
- }
+ characterEntryEndOfLastLineScrollingTest(25178);
+ }
- public function HOLTR_dragRightScrollingTest():void
- {
- dragRightScrollingTest(29);
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_spaceEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HOLTR_dragLeftScrollingTest():void
- {
- dragLeftScrollingTest(19960);
- }
+ spaceEntryEndOfFirstLineScrollingTest(19977);
+ }
- public function HOLTR_characterEntryEndOfFirstLineScrollingTest():void
- {
- characterEntryEndOfFirstLineScrollingTest(19977)
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_spaceEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HOLTR_characterEntryEndOfLastLineScrollingTest():void
- {
- characterEntryEndOfLastLineScrollingTest(25178);
- }
+ spaceEntryEndOfLastLineScrollingTest(25178);
+ }
- public function HOLTR_spaceEntryEndOfFirstLineScrollingTest():void
- {
- spaceEntryEndOfFirstLineScrollingTest(19977);
- }
+ [Test(dataProvider=HORTLTestDp)]
+ public function HORTL_backspaceScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HOLTR_spaceEntryEndOfLastLineScrollingTest():void
- {
- spaceEntryEndOfLastLineScrollingTest(25178);
- }
+ backspaceScrollingTest(19936);
+ }
- public function HOLTR_backspaceScrollingTest():void
- {
- backspaceScrollingTest(19936);
- }
+ // Vertical Orientation Left To Right Direction Scrolling Tests.
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_endKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- // Vertical Orientation Left To Right Direction Scrolling Tests.
+ endKeyScrollingTest(20326);
+ }
- public function VOLTR_endKeyScrollingTest():void
- {
- endKeyScrollingTest(20326);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_homeKeyScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function VOLTR_homeKeyScrollingTest():void
- {
- homeKeyScrollingTest(19);
- }
+ homeKeyScrollingTest(19);
+ }
- public function VOLTR_cursorRightScrollingTest():void
- {
- cursorRightScrollingTest(378);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_cursorRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function VOLTR_cursorLeftScrollingTest():void
- {
- cursorLeftScrollingTest(19960);
- }
+ cursorRightScrollingTest(378);
+ }
- public function VOLTR_dragRightScrollingTest():void
- {
- dragRightScrollingTest(378);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_cursorLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function VOLTR_dragLeftScrollingTest():void
- {
- dragLeftScrollingTest(19960);
- }
+ cursorLeftScrollingTest(19960);
+ }
- public function VOLTR_characterEntryEndOfFirstLineScrollingTest():void
- {
- characterEntryEndOfFirstLineScrollingTest(20326)
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_dragRightScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function VOLTR_characterEntryEndOfLastLineScrollingTest():void
- {
- characterEntryEndOfLastLineScrollingTest(25527);
- }
+ dragRightScrollingTest(378);
+ }
- public function VOLTR_spaceEntryEndOfFirstLineScrollingTest():void
- {
- spaceEntryEndOfFirstLineScrollingTest(20326);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_dragLeftScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function VOLTR_spaceEntryEndOfLastLineScrollingTest():void
- {
- spaceEntryEndOfLastLineScrollingTest(25527);
- }
+ dragLeftScrollingTest(19960);
+ }
- public function VOLTR_backspaceScrollingTest():void
- {
- backspaceScrollingTest(19936);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_characterEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
+ characterEntryEndOfFirstLineScrollingTest(20326)
+ }
- // Horizontal Orientation Left To Right Direction Scrolling Tests.
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_characterEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HORTL_endKeyScrollingTest():void
- {
- endKeyScrollingTest(19977);
- }
+ characterEntryEndOfLastLineScrollingTest(25527);
+ }
- public function HORTL_homeKeyScrollingTest():void
- {
- homeKeyScrollingTest(19);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_spaceEntryEndOfFirstLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HORTL_cursorRightScrollingTest():void
- {
- cursorRightScrollingTest(29);
- }
+ spaceEntryEndOfFirstLineScrollingTest(20326);
+ }
- public function HORTL_cursorLeftScrollingTest():void
- {
- cursorLeftScrollingTest(19960);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_spaceEntryEndOfLastLineScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HORTL_dragRightScrollingTest():void
- {
- dragRightScrollingTest(29);
- }
+ spaceEntryEndOfLastLineScrollingTest(25527);
+ }
- public function HORTL_dragLeftScrollingTest():void
- {
- dragLeftScrollingTest(19960);
- }
+ [Test(dataProvider=VORTLDp)]
+ public function VORTL_backspaceScrollingTest(testCaseVo:TestCaseVo):void
+ {
+ TestData.fileName = testCaseVo.fileName;
+ super.setUpTest();
- public function HORTL_characterEntryEndOfFirstLineScrollingTest():void
- {
- characterEntryEndOfFirstLineScrollingTest(19977)
- }
+ backspaceScrollingTest(19936);
+ }
- public function HORTL_characterEntryEndOfLastLineScrollingTest():void
- {
- characterEntryEndOfLastLineScrollingTest(25178);
- }
- public function HORTL_spaceEntryEndOfFirstLineScrollingTest():void
- {
- spaceEntryEndOfFirstLineScrollingTest(19977);
- }
+ // Send a keyboard gesture using values listed above
+ // Code folding extremely recommended here
+ private function sendKeyboardGesture(type:int):void
+ {
+ var charCode:int;
+ var keyCode:int;
+ var ctrlDown:Boolean = false;
+ var shiftDown:Boolean = false;
+ var altDown:Boolean = false;
- public function HORTL_spaceEntryEndOfLastLineScrollingTest():void
- {
- spaceEntryEndOfLastLineScrollingTest(25178);
- }
+ var leftCode:int = 37;
+ var rightCode:int = 39;
+ var upCode:int = 38;
+ var downCode:int = 40;
- public function HORTL_backspaceScrollingTest():void
- {
- backspaceScrollingTest(19936);
- }
+ // Arrow keys behave differently on Right to Left Blockprogression
+ // For the sake of test simplicity, I am translating the directions here
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL)
+ {
+ leftCode = 38;
+ rightCode = 40;
+ upCode = 39;
+ downCode = 37;
+ }
+ switch (type)
+ {
+ case CTRL_BACKSPACE:
+ charCode = 8;
+ keyCode = 8;
+ ctrlDown = true;
+ break;
+ case CTRL_DELETE:
+ charCode = 127;
+ keyCode = 46;
+ ctrlDown = true;
+ break;
+ case OPT_BACKSPACE:
+ charCode = 8;
+ keyCode = 8;
+ altDown = true;
+ break;
+ case OPT_DELETE:
+ charCode = 127;
+ keyCode = 46;
+ altDown = true;
+ break;
+ case CTRL_LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ ctrlDown = true;
+ break;
+ case CTRL_RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ ctrlDown = true;
+ break;
+ case CTRL_UP:
+ charCode = 0;
+ keyCode = upCode;
+ ctrlDown = true;
+ break;
+ case CTRL_DOWN:
+ charCode = 0;
+ keyCode = downCode;
+ ctrlDown = true;
+ break;
+ case OPT_LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ altDown = true;
+ break;
+ case OPT_RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ altDown = true;
+ break;
+ case OPT_UP:
+ charCode = 0;
+ keyCode = upCode;
+ altDown = true;
+ break;
+ case OPT_DOWN:
+ charCode = 0;
+ keyCode = downCode;
+ altDown = true;
+ break;
+ case SHIFT_LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ ctrlDown = false;
+ shiftDown = true;
+ break;
+ case SHIFT_RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ ctrlDown = false;
+ shiftDown = true;
+ break;
+ case SHIFT_CTRL_LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_CTRL_RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_CTRL_UP:
+ charCode = 0;
+ keyCode = upCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_CTRL_DOWN:
+ charCode = 0;
+ keyCode = downCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_OPT_LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_OPT_RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_OPT_UP:
+ charCode = 0;
+ keyCode = upCode;
+ ctrlDown = true;
+ shiftDown = true;
+ break;
+ case SHIFT_OPT_DOWN:
+ charCode = 0;
+ keyCode = downCode;
+ altDown = true;
+ shiftDown = true;
+ break;
+ case HOME:
+ charCode = 0;
+ keyCode = 36;
+ break;
+ case END:
+ charCode = 0;
+ keyCode = 35;
+ break;
+ case SHIFT_HOME:
+ charCode = 0;
+ keyCode = 36;
+ shiftDown = true;
+ break;
+ case SHIFT_END:
+ charCode = 0;
+ keyCode = 35;
+ shiftDown = true;
+ break;
+ case CTRL_HOME:
+ charCode = 0;
+ keyCode = 36;
+ ctrlDown = true;
+ break;
+ case CTRL_END:
+ charCode = 0;
+ keyCode = 35;
+ ctrlDown = true;
+ break;
+ case SHIFT_CTRL_HOME:
+ charCode = 0;
+ keyCode = 36;
+ shiftDown = true;
+ ctrlDown = true;
+ break;
+ case SHIFT_CTRL_END:
+ charCode = 0;
+ keyCode = 35;
+ shiftDown = true;
+ ctrlDown = true;
+ break;
+ case PG_UP:
+ charCode = 0;
+ keyCode = 33;
+ break;
+ case PG_DOWN:
+ charCode = 0;
+ keyCode = 34;
+ break;
+ case SHIFT_PG_UP:
+ charCode = 0;
+ keyCode = 33;
+ shiftDown = true;
+ break;
+ case SHIFT_PG_DOWN:
+ charCode = 0;
+ keyCode = 34;
+ shiftDown = true;
+ break;
+ case UP:
+ charCode = 0;
+ keyCode = upCode;
+ break;
+ case DOWN:
+ charCode = 0;
+ keyCode = downCode;
+ break;
+ case LEFT:
+ charCode = 0;
+ keyCode = leftCode;
+ break;
+ case RIGHT:
+ charCode = 0;
+ keyCode = rightCode;
+ break;
+ default:
+ return;
+ }
- // Vertical Orientation Left To Right Direction Scrolling Tests.
+ var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN,
+ true, false, charCode, keyCode, KeyLocation.STANDARD, ctrlDown, altDown, shiftDown);
+ TestFrame.container["dispatchEvent"](kEvent);
+ }
- public function VORTL_endKeyScrollingTest():void
- {
- endKeyScrollingTest(20326);
- }
+ private function endKeyScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("endKeyScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("endKeyScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("endKeyScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("endKeyScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
- public function VORTL_homeKeyScrollingTest():void
- {
- homeKeyScrollingTest(19);
- }
+ }
- public function VORTL_cursorRightScrollingTest():void
- {
- cursorRightScrollingTest(378);
- }
+ private function homeKeyScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Hit the Home key to scroll to the end of the first line.
+ sendKeyboardGesture(HOME);
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("homeKeyScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("homeKeyScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("homeKeyScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("homeKeyScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_cursorLeftScrollingTest():void
- {
- cursorLeftScrollingTest(19960);
- }
+ private function cursorRightScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Hit the Home key to scroll to the end of the first line.
+ sendKeyboardGesture(HOME);
+ // Move the cursor over to the right.
+ for (var i:Number = 0; i < 37; i++)
+ {
+ sendKeyboardGesture(RIGHT);
+ }
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("cursorRightScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("cursorRightScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("cursorRightScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("cursorRightScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_dragRightScrollingTest():void
- {
- dragRightScrollingTest(378);
- }
+ private function cursorLeftScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Move the cursor over to the right.
+ for (var i:Number = 0; i < 41; i++)
+ {
+ sendKeyboardGesture(LEFT);
+ }
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("cursorLeftScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("cursorLeftScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("cursorLeftScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("cursorLeftScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_dragLeftScrollingTest():void
- {
- dragLeftScrollingTest(19960);
- }
- public function VORTL_characterEntryEndOfFirstLineScrollingTest():void
- {
- characterEntryEndOfFirstLineScrollingTest(20326)
- }
+ private function dragRightScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Hit the Home key to scroll to the end of the first line.
+ sendKeyboardGesture(HOME);
+ // Move the cursor to the selection that will cause a drag.
+ // Move the cursor over to the right.
+ for (var i:Number = 0; i < 36; i++)
+ {
+ sendKeyboardGesture(RIGHT);
+ }
+ sendKeyboardGesture(SHIFT_RIGHT);
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("dragRightScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("dragRightScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("dragRightScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("dragRightScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_characterEntryEndOfLastLineScrollingTest():void
- {
- characterEntryEndOfLastLineScrollingTest(25527);
- }
+ private function dragLeftScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Move the cursor to the selection that will cause a drag.
+ // Move the cursor over to the right.
+ for (var i:Number = 0; i < 40; i++)
+ {
+ sendKeyboardGesture(LEFT);
+ }
+ sendKeyboardGesture(SHIFT_LEFT);
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("dragLeftScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("dragLeftScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("dragLeftScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("dragLeftScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_spaceEntryEndOfFirstLineScrollingTest():void
- {
- spaceEntryEndOfFirstLineScrollingTest(20326);
- }
+ private function characterEntryEndOfFirstLineScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Type in ABC and confirm that it scrolls.
+ SelManager.insertText(" ABC");
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("characterEntryEndOfFirstLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("characterEntryEndOfFirstLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("characterEntryEndOfFirstLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("characterEntryEndOfFirstLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_spaceEntryEndOfLastLineScrollingTest():void
- {
- spaceEntryEndOfLastLineScrollingTest(25527);
- }
+ private function characterEntryEndOfLastLineScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the CTRL+End key to scroll to the end of the last line.
+ sendKeyboardGesture(CTRL_END);
+ // Type in ABC and confirm that it scrolls.
+ SelManager.insertText(" ABC");
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("characterEntryEndOfLastLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("characterEntryEndOfLastLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("characterEntryEndOfLastLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("characterEntryEndOfLastLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- public function VORTL_backspaceScrollingTest():void
- {
- backspaceScrollingTest(19936);
- }
+ private function spaceEntryEndOfFirstLineScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Type in ABC and confirm that it scrolls.
+ SelManager.insertText(" ");
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("spaceEntryEndOfFirstLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("spaceEntryEndOfFirstLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("spaceEntryEndOfFirstLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("spaceEntryEndOfFirstLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
+ private function spaceEntryEndOfLastLineScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the CTRL+End key to scroll to the end of the last line.
+ sendKeyboardGesture(CTRL_END);
+ // Type in ABC and confirm that it scrolls.
+ SelManager.insertText(" ");
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("spaceEntryEndOfLastLineScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("spaceEntryEndOfLastLineScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("spaceEntryEndOfLastLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("spaceEntryEndOfLastLineScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
- }
+ private function backspaceScrollingTest(scrollPos:Number):void
+ {
+ // Success or failure will be determined by the bitmap snapshot.
+ // Move the cursor to the beginning of the first line.
+ SelManager.selectRange(0, 0);
+ // Hit the End key to scroll to the end of the first line.
+ sendKeyboardGesture(END);
+ // Move the cursor to the selection that will cause a drag.
+ // Move the cursor over to the right.
+ for (var i:Number = 0; i < 40; i++)
+ {
+ sendKeyboardGesture(LEFT);
+ }
+ for (i = 0; i < 3; i++)
+ {
+ SelManager.deletePreviousCharacter();
+ }
+ var tmpContainerController:ContainerController = ContainerController(SelManager.textFlow.flowComposer.getControllerAt(0));
+ // trace("backspaceScrollingTestHP=" + tmpContainerController.horizontalScrollPosition);
+ // trace("backspaceScrollingTestVP=" + tmpContainerController.verticalScrollPosition);
+ if (SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB)
+ {
+ assertTrue("backspaceScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.verticalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ else
+ {
+ assertTrue("backspaceScrollingTest Test Failed.", (scrollPos < Math.abs(tmpContainerController.horizontalScrollPosition) < (scrollPos + 1)) == true);
+ }
+ }
+ }
}