You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by mi...@apache.org on 2016/09/19 11:36:37 UTC
[1/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35126
Removing unused variables, making elligible functions static,
correcting an asdoc typo, and removing superfluous multiplication by 1.
Repository: flex-sdk
Updated Branches:
refs/heads/develop 8f3dd5bb0 -> 0dff7f486
FLEX-35126 Removing unused variables, making elligible functions static, correcting an asdoc typo, and removing superfluous multiplication by 1.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/a797884a
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/a797884a
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/a797884a
Branch: refs/heads/develop
Commit: a797884adf4c2c1484c83ba2780ec8adbc06b095
Parents: 8f3dd5b
Author: Mihai Chira <mi...@apache.org>
Authored: Mon Sep 19 11:42:53 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Mon Sep 19 11:42:53 2016 +0200
----------------------------------------------------------------------
.../src/mx/controls/listClasses/AdvancedListBase.as | 3 +--
.../HierarchicalCollectionView_FLEX_34775_Tests.as | 4 ++--
.../src/mx/managers/NativeDragManagerImpl.as | 2 +-
.../src/spark/components/gridClasses/GridViewLayout.as | 12 ++++--------
4 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a797884a/frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as b/frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
index 8482454..854f0df 100644
--- a/frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
+++ b/frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
@@ -5401,7 +5401,6 @@ public class AdvancedListBase extends ScrollControlBase
var selectionChange:Boolean = false;
var placeHolder:CursorBookmark = iterator.bookmark;
var index:int = itemRendererToIndex(item);
- var data:Object;
var uid:String = itemToUID(item.data);
if (!allowMultipleSelection || (!shiftKey && !ctrlKey))
@@ -5508,7 +5507,7 @@ public class AdvancedListBase extends ScrollControlBase
iterator.seek(placeHolder, 0);
// if user is clicking with ctl key then
- // seletion gets changed always.
+ // selection gets changed always.
selectionChange = true;
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a797884a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
index 14bc2a3..b91d114 100644
--- a/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
+++ b/frameworks/projects/advancedgrids/tests/mx/collections/HierarchicalCollectionView_FLEX_34775_Tests.as
@@ -101,7 +101,7 @@ package mx.collections
{
function filterOutLocationNode(node:DataNode):Boolean {
return node && node.label != locationNodeName;
- };
+ }
const locationNodeName:String = StringUtil.trim(HIERARCHY_STRING.split("\n")[2]);
@@ -123,7 +123,7 @@ package mx.collections
assertEquals(1, _sut.length);
}
- private function attemptNavigation(into:HierarchicalCollectionView):int
+ private static function attemptNavigation(into:HierarchicalCollectionView):int
{
var cursor:IViewCursor = into.createCursor();
var i:int = 0;
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a797884a/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as b/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as
index 63ea9f2..5e582a0 100644
--- a/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as
+++ b/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as
@@ -390,7 +390,7 @@ public class NativeDragManagerImpl implements IDragManager
{
if (removeImage)
_dragImage.removeEventListener(FlexEvent.UPDATE_COMPLETE, initiateDrag);
- var dragBitmap:BitmapData
+ var dragBitmap:BitmapData;
if (_dragImage.width && _dragImage.height)
dragBitmap = new BitmapData(_dragImage.width, _dragImage.height, true, 0x000000);
else
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a797884a/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as b/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
index 4dbaf11..9c072b7 100644
--- a/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
+++ b/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as
@@ -685,7 +685,7 @@ public class GridViewLayout extends LayoutBase
// so it could be seen when the indicator bounds are below the last row.
// The issue is there may not be any space below the last row and the drop
// indicator would not be visible if it started at the top of the next cell.
- if (dropLocation.dropPoint.y > (bounds.top + (bounds.height * 1) / 2))
+ if (dropLocation.dropPoint.y > (bounds.top + bounds.height / 2))
return new Rectangle(2, bounds.bottom - 2, bounds.width -4, 4);
return new Rectangle(2, Math.max(0, bounds.y - 2), bounds.width - 4, 4);
@@ -708,7 +708,7 @@ public class GridViewLayout extends LayoutBase
clearSelectionIndicators();
- freeGridElement(hoverIndicator)
+ freeGridElement(hoverIndicator);
hoverIndicator = null;
freeGridElement(caretIndicator);
@@ -844,7 +844,7 @@ public class GridViewLayout extends LayoutBase
if (vspChanged && hspChanged)
reason = "bothScrollPositions";
else if (vspChanged)
- reason = "verticalScrollPosition"
+ reason = "verticalScrollPosition";
else if (hspChanged)
reason = "horizontalScrollPosition";
@@ -1389,7 +1389,6 @@ public class GridViewLayout extends LayoutBase
return;
const columnCount:int = getColumnsLength();
- const columnGap:int = gridDimensionsView.columnGap;
const requestedColumnCount:int = grid.requestedColumnCount; // TBD GridView...
var measuredColumnCount:int = 0;
@@ -1673,7 +1672,7 @@ public class GridViewLayout extends LayoutBase
var colWidth:Number = gridDimensionsView.getColumnWidth(colIndex);
layoutItemRenderer(renderer, cellX, cellY, colWidth, rowHeight);
- var preferredRowHeight:Number = renderer.getPreferredBoundsHeight()
+ var preferredRowHeight:Number = renderer.getPreferredBoundsHeight();
gridDimensionsView.setCellHeight(rowIndex, colIndex, preferredRowHeight);
cellX += colWidth + colGap;
}
@@ -2438,9 +2437,6 @@ public class GridViewLayout extends LayoutBase
return indicator;
}
- private var mouseXOffset:Number = 0;
- private var mouseYOffset:Number = 0;
-
private function layoutHoverIndicator(layer:GridLayer):void
{
const rowIndex:int = gridRowIndexToViewIndex(grid.hoverRowIndex);
[4/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-26808
Increased a test function's timeout and added a bit more information to see
why another is failing.
Posted by mi...@apache.org.
FLEX-26808 Increased a test function's timeout and added a bit more information to see why another is failing.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/0dff7f48
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/0dff7f48
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/0dff7f48
Branch: refs/heads/develop
Commit: 0dff7f4862f8937bd97c67ff7b02fe7245f77646
Parents: 631b09c
Author: Mihai Chira <mi...@apache.org>
Authored: Mon Sep 19 13:35:33 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Mon Sep 19 13:35:33 2016 +0200
----------------------------------------------------------------------
.../spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0dff7f48/frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as b/frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as
index de01b88..1480448 100644
--- a/frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as
+++ b/frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_26808_Tests.as
@@ -188,7 +188,7 @@ package spark.components {
_sut.selectedIndices = new <int>[0, 1];
//then
- assertTrue(ArrayUtil.arraysMatch([_firstObject, _secondObject], VectorUtil.toArrayObject(_sut.selectedItems)));
+ assertTrue("The first two objects should be selected", ArrayUtil.arraysMatch([_firstObject, _secondObject], VectorUtil.toArrayObject(_sut.selectedItems)));
//given
const mouseDown:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 5, 5, null, false, false, false);
@@ -204,7 +204,7 @@ package spark.components {
_sut.removeEventListener(GridEvent.GRID_MOUSE_DOWN, onGridMouseDown);
}
- [Test(async, timeout=1000)]
+ [Test(async, timeout=1300)]
public function test_dragging_maintains_manually_selected_items():void
{
//when
@@ -215,7 +215,7 @@ package spark.components {
noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
- Async.handleEvent(this, _finishNotifier, Event.COMPLETE, test_programmatic_selection_and_dragging, 800);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, test_programmatic_selection_and_dragging, 1200);
}
private function test_manual_selection_of_two_items_and_dragging(event:Event, passThroughData:Object):void
Re: [2/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35126
Added a unit test to reprouce the bug. Currently it passes, as expected. (But
if I manually put back the fix for FLEX-34088, it fails, as it should,
meaning it actually tests the correc...
Posted by Alex Harui <ah...@adobe.com>.
Mihai,
The http://apacheflexbuild.cloudapp.net:8080/job/flex-sdk_test/ job keeps
hanging on this new test. I have disabled the job. Please investigate
and re-enable the job when things are working again.
Thanks,
-Alex
On 9/19/16, 4:36 AM, "mihaic@apache.org" <mi...@apache.org> wrote:
>FLEX-35126 Added a unit test to reprouce the bug. Currently it passes, as
>expected. (But if I manually put back the fix for FLEX-34088, it fails,
>as it should, meaning it actually tests the correct bug.)
>
>
>Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/3d71f1b5
>Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/3d71f1b5
>Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/3d71f1b5
>
>Branch: refs/heads/develop
>Commit: 3d71f1b5e458ee39f439ef68db092ed08a8935df
>Parents: a797884
>Author: Mihai Chira <mi...@apache.org>
>Authored: Mon Sep 19 13:24:17 2016 +0200
>Committer: Mihai Chira <mi...@apache.org>
>Committed: Mon Sep 19 13:24:17 2016 +0200
>
>----------------------------------------------------------------------
> .../components/DropDownList_FLEX_35126_Tests.as | 182 +++++++++++++++++++
> 1 file changed, 182 insertions(+)
>----------------------------------------------------------------------
>
>
>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3d71f1b5/frameworks/p
>rojects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as
>----------------------------------------------------------------------
>diff --git
>a/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>new file mode 100644
>index 0000000..82ab10e
>--- /dev/null
>+++
>b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>@@ -0,0 +1,182 @@
>+/////////////////////////////////////////////////////////////////////////
>///////
>+//
>+// 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 spark.components {
>+ import flash.events.Event;
>+ import flash.events.EventDispatcher;
>+ import flash.events.MouseEvent;
>+
>+ import mx.events.FlexMouseEvent;
>+
>+ import org.flexunit.assertThat;
>+ import org.flexunit.asserts.assertEquals;
>+ import org.flexunit.asserts.assertFalse;
>+ import org.flexunit.asserts.assertTrue;
>+ import org.flexunit.async.Async;
>+ import org.fluint.uiImpersonation.UIImpersonator;
>+
>+ public class DropDownList_FLEX_35126_Tests
>+ {
>+ private static const NO_ENTER_FRAMES_TO_ALLOW:int = 2;
>+ private static var noEnterFramesRemaining:int = NaN;
>+ private static const _finishNotifier:EventDispatcher = new
>EventDispatcher();
>+
>+ private static var _sut:DropDownListInspectable;
>+ private static var _dropDownListOnStage:DropDownList;
>+ private var _popUp:PopUpAnchor;
>+
>+ [Before]
>+ public function setUp():void
>+ {
>+ _popUp = new PopUpAnchor();
>+ _popUp.displayPopUp = true;
>+
>+ _sut = new DropDownListInspectable();
>+ _sut.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
>onMouseDownOutsidePopup);
>+
>+ _popUp.popUp = _sut;
>+
>+ _dropDownListOnStage = new DropDownList();
>+ }
>+
>+ private function
>onMouseDownOutsidePopup(event:FlexMouseEvent):void
>+ {
>+ _popUp.displayPopUp = false;
>+ }
>+
>+ [After]
>+ public function tearDown():void
>+ {
>+ _sut = null;
>+ _popUp = null;
>+ _dropDownListOnStage = null;
>+ }
>+
>+ [Test(async, timeout=1000)]
>+ public function
>test_dropdown_doesnt_close_when_item_selected_from_DropDownList():void
>+ {
>+ //given
>+ _popUp.width = _sut.width = 150;
>+ _dropDownListOnStage.x = 200;
>+ UIImpersonator.addChild(_popUp);
>+ UIImpersonator.addChild(_dropDownListOnStage);
>+
>+ //then
>+ assertTrue(_popUp.displayPopUp);
>+
>assertThat(isNaN(_sut.dropDownController_.rollOverOpenDelay));
>+
>+ //when
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then - wait a frame
>+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
>+
>UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE,
>then_open_drop_down, 300);
>+ }
>+
>+ private function then_open_drop_down(event:Event,
>passThroughData:Object):void
>+ {
>+ //when - MOUSE_UP to signify the lifting of the mouse button
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_UP));
>+
>+ //then
>+ assertTrue(_sut.isDropDownOpen);
>+
>+ //when - MOUSE_DOWN on the stage dropDownList
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then - wait a frame
>+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
>+
>UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE,
>then_select_item_in_drop_down, 300);
>+ }
>+
>+ private function then_select_item_in_drop_down(event:Event,
>passThroughData:Object):void
>+ {
>+ //when - MOUSE_UP to signify the lifting of the mouse button
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_UP));
>+
>+ //then
>+ assertFalse("PopUpAnchor should be closed",
>_popUp.displayPopUp);
>+ assertTrue(_dropDownListOnStage.isDropDownOpen);
>+
>+ //when - second click on stage dropdown
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then
>+ assertEquals("The DropDownController should have closed the
>DropDownList at the first click on the other DropDownList, and stopped
>listening to mouse events", 1, _sut.noReactionsToOutsideClick);
>+ }
>+
>+ private static function onEnterFrame(event:Event):void
>+ {
>+ if(!--noEnterFramesRemaining)
>+ {
>+
>UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
>+ }
>+ }
>+ }
>+}
>+
>+import flash.events.Event;
>+
>+import mx.core.mx_internal;
>+
>+import spark.components.DropDownList;
>+import spark.components.supportClasses.DropDownController;
>+import spark.skins.spark.DropDownListSkin;
>+
>+use namespace mx_internal;
>+
>+class DropDownListInspectable extends DropDownList
>+{
>+ public var noReactionsToOutsideClick:int = 0;
>+
>+ public function DropDownListInspectable()
>+ {
>+ super();
>+ this.setStyle("skinClass", DropDownListSkin);
>+ this.dropDownController = new DropDownControllerInspectable();
>+
>this.dropDownController.addEventListener(DropDownControllerInspectable.REA
>CT_TO_MOUSE_DOWN, onControllerReactedToMouseDown);
>+ }
>+
>+ private function onControllerReactedToMouseDown(event:Event):void
>+ {
>+ noReactionsToOutsideClick++;
>+ }
>+
>+ public function get dropDownController_():DropDownController
>+ {
>+ return this.dropDownController;
>+ }
>+}
>+
>+class DropDownControllerInspectable extends DropDownController
>+{
>+ public static const REACT_TO_MOUSE_DOWN:String =
>"justReactedToMouseDown";
>+
>+ override mx_internal function
>systemManager_mouseDownHandler(event:Event):void
>+ {
>+ super.mx_internal::systemManager_mouseDownHandler(event);
>+ dispatchEvent(new Event(REACT_TO_MOUSE_DOWN));
>+ }
>+}
>\ No newline at end of file
>
Re: [2/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35126
Added a unit test to reprouce the bug. Currently it passes, as expected. (But
if I manually put back the fix for FLEX-34088, it fails, as it should,
meaning it actually tests the correc...
Posted by Alex Harui <ah...@adobe.com>.
Mihai,
The http://apacheflexbuild.cloudapp.net:8080/job/flex-sdk_test/ job keeps
hanging on this new test. I have disabled the job. Please investigate
and re-enable the job when things are working again.
Thanks,
-Alex
On 9/19/16, 4:36 AM, "mihaic@apache.org" <mi...@apache.org> wrote:
>FLEX-35126 Added a unit test to reprouce the bug. Currently it passes, as
>expected. (But if I manually put back the fix for FLEX-34088, it fails,
>as it should, meaning it actually tests the correct bug.)
>
>
>Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/3d71f1b5
>Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/3d71f1b5
>Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/3d71f1b5
>
>Branch: refs/heads/develop
>Commit: 3d71f1b5e458ee39f439ef68db092ed08a8935df
>Parents: a797884
>Author: Mihai Chira <mi...@apache.org>
>Authored: Mon Sep 19 13:24:17 2016 +0200
>Committer: Mihai Chira <mi...@apache.org>
>Committed: Mon Sep 19 13:24:17 2016 +0200
>
>----------------------------------------------------------------------
> .../components/DropDownList_FLEX_35126_Tests.as | 182 +++++++++++++++++++
> 1 file changed, 182 insertions(+)
>----------------------------------------------------------------------
>
>
>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3d71f1b5/frameworks/p
>rojects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as
>----------------------------------------------------------------------
>diff --git
>a/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>new file mode 100644
>index 0000000..82ab10e
>--- /dev/null
>+++
>b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126
>_Tests.as
>@@ -0,0 +1,182 @@
>+/////////////////////////////////////////////////////////////////////////
>///////
>+//
>+// 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 spark.components {
>+ import flash.events.Event;
>+ import flash.events.EventDispatcher;
>+ import flash.events.MouseEvent;
>+
>+ import mx.events.FlexMouseEvent;
>+
>+ import org.flexunit.assertThat;
>+ import org.flexunit.asserts.assertEquals;
>+ import org.flexunit.asserts.assertFalse;
>+ import org.flexunit.asserts.assertTrue;
>+ import org.flexunit.async.Async;
>+ import org.fluint.uiImpersonation.UIImpersonator;
>+
>+ public class DropDownList_FLEX_35126_Tests
>+ {
>+ private static const NO_ENTER_FRAMES_TO_ALLOW:int = 2;
>+ private static var noEnterFramesRemaining:int = NaN;
>+ private static const _finishNotifier:EventDispatcher = new
>EventDispatcher();
>+
>+ private static var _sut:DropDownListInspectable;
>+ private static var _dropDownListOnStage:DropDownList;
>+ private var _popUp:PopUpAnchor;
>+
>+ [Before]
>+ public function setUp():void
>+ {
>+ _popUp = new PopUpAnchor();
>+ _popUp.displayPopUp = true;
>+
>+ _sut = new DropDownListInspectable();
>+ _sut.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
>onMouseDownOutsidePopup);
>+
>+ _popUp.popUp = _sut;
>+
>+ _dropDownListOnStage = new DropDownList();
>+ }
>+
>+ private function
>onMouseDownOutsidePopup(event:FlexMouseEvent):void
>+ {
>+ _popUp.displayPopUp = false;
>+ }
>+
>+ [After]
>+ public function tearDown():void
>+ {
>+ _sut = null;
>+ _popUp = null;
>+ _dropDownListOnStage = null;
>+ }
>+
>+ [Test(async, timeout=1000)]
>+ public function
>test_dropdown_doesnt_close_when_item_selected_from_DropDownList():void
>+ {
>+ //given
>+ _popUp.width = _sut.width = 150;
>+ _dropDownListOnStage.x = 200;
>+ UIImpersonator.addChild(_popUp);
>+ UIImpersonator.addChild(_dropDownListOnStage);
>+
>+ //then
>+ assertTrue(_popUp.displayPopUp);
>+
>assertThat(isNaN(_sut.dropDownController_.rollOverOpenDelay));
>+
>+ //when
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then - wait a frame
>+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
>+
>UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE,
>then_open_drop_down, 300);
>+ }
>+
>+ private function then_open_drop_down(event:Event,
>passThroughData:Object):void
>+ {
>+ //when - MOUSE_UP to signify the lifting of the mouse button
>+ _sut.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_UP));
>+
>+ //then
>+ assertTrue(_sut.isDropDownOpen);
>+
>+ //when - MOUSE_DOWN on the stage dropDownList
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then - wait a frame
>+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
>+
>UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE,
>then_select_item_in_drop_down, 300);
>+ }
>+
>+ private function then_select_item_in_drop_down(event:Event,
>passThroughData:Object):void
>+ {
>+ //when - MOUSE_UP to signify the lifting of the mouse button
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_UP));
>+
>+ //then
>+ assertFalse("PopUpAnchor should be closed",
>_popUp.displayPopUp);
>+ assertTrue(_dropDownListOnStage.isDropDownOpen);
>+
>+ //when - second click on stage dropdown
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.ROLL_OVER));
>+ _dropDownListOnStage.openButton.dispatchEvent(new
>MouseEvent(MouseEvent.MOUSE_DOWN));
>+
>+ //then
>+ assertEquals("The DropDownController should have closed the
>DropDownList at the first click on the other DropDownList, and stopped
>listening to mouse events", 1, _sut.noReactionsToOutsideClick);
>+ }
>+
>+ private static function onEnterFrame(event:Event):void
>+ {
>+ if(!--noEnterFramesRemaining)
>+ {
>+
>UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME,
>onEnterFrame);
>+ _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
>+ }
>+ }
>+ }
>+}
>+
>+import flash.events.Event;
>+
>+import mx.core.mx_internal;
>+
>+import spark.components.DropDownList;
>+import spark.components.supportClasses.DropDownController;
>+import spark.skins.spark.DropDownListSkin;
>+
>+use namespace mx_internal;
>+
>+class DropDownListInspectable extends DropDownList
>+{
>+ public var noReactionsToOutsideClick:int = 0;
>+
>+ public function DropDownListInspectable()
>+ {
>+ super();
>+ this.setStyle("skinClass", DropDownListSkin);
>+ this.dropDownController = new DropDownControllerInspectable();
>+
>this.dropDownController.addEventListener(DropDownControllerInspectable.REA
>CT_TO_MOUSE_DOWN, onControllerReactedToMouseDown);
>+ }
>+
>+ private function onControllerReactedToMouseDown(event:Event):void
>+ {
>+ noReactionsToOutsideClick++;
>+ }
>+
>+ public function get dropDownController_():DropDownController
>+ {
>+ return this.dropDownController;
>+ }
>+}
>+
>+class DropDownControllerInspectable extends DropDownController
>+{
>+ public static const REACT_TO_MOUSE_DOWN:String =
>"justReactedToMouseDown";
>+
>+ override mx_internal function
>systemManager_mouseDownHandler(event:Event):void
>+ {
>+ super.mx_internal::systemManager_mouseDownHandler(event);
>+ dispatchEvent(new Event(REACT_TO_MOUSE_DOWN));
>+ }
>+}
>\ No newline at end of file
>
[2/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-35126 Added
a unit test to reprouce the bug. Currently it passes,
as expected. (But if I manually put back the fix for FLEX-34088, it fails,
as it should, meaning it actually tests the correct bug.
Posted by mi...@apache.org.
FLEX-35126 Added a unit test to reprouce the bug. Currently it passes, as expected. (But if I manually put back the fix for FLEX-34088, it fails, as it should, meaning it actually tests the correct bug.)
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/3d71f1b5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/3d71f1b5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/3d71f1b5
Branch: refs/heads/develop
Commit: 3d71f1b5e458ee39f439ef68db092ed08a8935df
Parents: a797884
Author: Mihai Chira <mi...@apache.org>
Authored: Mon Sep 19 13:24:17 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Mon Sep 19 13:24:17 2016 +0200
----------------------------------------------------------------------
.../components/DropDownList_FLEX_35126_Tests.as | 182 +++++++++++++++++++
1 file changed, 182 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3d71f1b5/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as
new file mode 100644
index 0000000..82ab10e
--- /dev/null
+++ b/frameworks/projects/spark/tests/spark/components/DropDownList_FLEX_35126_Tests.as
@@ -0,0 +1,182 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 spark.components {
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+ import flash.events.MouseEvent;
+
+ import mx.events.FlexMouseEvent;
+
+ import org.flexunit.assertThat;
+ import org.flexunit.asserts.assertEquals;
+ import org.flexunit.asserts.assertFalse;
+ import org.flexunit.asserts.assertTrue;
+ import org.flexunit.async.Async;
+ import org.fluint.uiImpersonation.UIImpersonator;
+
+ public class DropDownList_FLEX_35126_Tests
+ {
+ private static const NO_ENTER_FRAMES_TO_ALLOW:int = 2;
+ private static var noEnterFramesRemaining:int = NaN;
+ private static const _finishNotifier:EventDispatcher = new EventDispatcher();
+
+ private static var _sut:DropDownListInspectable;
+ private static var _dropDownListOnStage:DropDownList;
+ private var _popUp:PopUpAnchor;
+
+ [Before]
+ public function setUp():void
+ {
+ _popUp = new PopUpAnchor();
+ _popUp.displayPopUp = true;
+
+ _sut = new DropDownListInspectable();
+ _sut.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, onMouseDownOutsidePopup);
+
+ _popUp.popUp = _sut;
+
+ _dropDownListOnStage = new DropDownList();
+ }
+
+ private function onMouseDownOutsidePopup(event:FlexMouseEvent):void
+ {
+ _popUp.displayPopUp = false;
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ _sut = null;
+ _popUp = null;
+ _dropDownListOnStage = null;
+ }
+
+ [Test(async, timeout=1000)]
+ public function test_dropdown_doesnt_close_when_item_selected_from_DropDownList():void
+ {
+ //given
+ _popUp.width = _sut.width = 150;
+ _dropDownListOnStage.x = 200;
+ UIImpersonator.addChild(_popUp);
+ UIImpersonator.addChild(_dropDownListOnStage);
+
+ //then
+ assertTrue(_popUp.displayPopUp);
+ assertThat(isNaN(_sut.dropDownController_.rollOverOpenDelay));
+
+ //when
+ _sut.openButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OVER));
+ _sut.openButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
+
+ //then - wait a frame
+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
+ UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_open_drop_down, 300);
+ }
+
+ private function then_open_drop_down(event:Event, passThroughData:Object):void
+ {
+ //when - MOUSE_UP to signify the lifting of the mouse button
+ _sut.openButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));
+
+ //then
+ assertTrue(_sut.isDropDownOpen);
+
+ //when - MOUSE_DOWN on the stage dropDownList
+ _dropDownListOnStage.openButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OVER));
+ _dropDownListOnStage.openButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
+
+ //then - wait a frame
+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
+ UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_select_item_in_drop_down, 300);
+ }
+
+ private function then_select_item_in_drop_down(event:Event, passThroughData:Object):void
+ {
+ //when - MOUSE_UP to signify the lifting of the mouse button
+ _dropDownListOnStage.openButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));
+
+ //then
+ assertFalse("PopUpAnchor should be closed", _popUp.displayPopUp);
+ assertTrue(_dropDownListOnStage.isDropDownOpen);
+
+ //when - second click on stage dropdown
+ _dropDownListOnStage.openButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OVER));
+ _dropDownListOnStage.openButton.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
+
+ //then
+ assertEquals("The DropDownController should have closed the DropDownList at the first click on the other DropDownList, and stopped listening to mouse events", 1, _sut.noReactionsToOutsideClick);
+ }
+
+ private static function onEnterFrame(event:Event):void
+ {
+ if(!--noEnterFramesRemaining)
+ {
+ UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
+ _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
+ }
+ }
+ }
+}
+
+import flash.events.Event;
+
+import mx.core.mx_internal;
+
+import spark.components.DropDownList;
+import spark.components.supportClasses.DropDownController;
+import spark.skins.spark.DropDownListSkin;
+
+use namespace mx_internal;
+
+class DropDownListInspectable extends DropDownList
+{
+ public var noReactionsToOutsideClick:int = 0;
+
+ public function DropDownListInspectable()
+ {
+ super();
+ this.setStyle("skinClass", DropDownListSkin);
+ this.dropDownController = new DropDownControllerInspectable();
+ this.dropDownController.addEventListener(DropDownControllerInspectable.REACT_TO_MOUSE_DOWN, onControllerReactedToMouseDown);
+ }
+
+ private function onControllerReactedToMouseDown(event:Event):void
+ {
+ noReactionsToOutsideClick++;
+ }
+
+ public function get dropDownController_():DropDownController
+ {
+ return this.dropDownController;
+ }
+}
+
+class DropDownControllerInspectable extends DropDownController
+{
+ public static const REACT_TO_MOUSE_DOWN:String = "justReactedToMouseDown";
+
+ override mx_internal function systemManager_mouseDownHandler(event:Event):void
+ {
+ super.mx_internal::systemManager_mouseDownHandler(event);
+ dispatchEvent(new Event(REACT_TO_MOUSE_DOWN));
+ }
+}
\ No newline at end of file
[3/4] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34088 Using
addChild instead of addElement for FlexUnit to get the test to run.
Posted by mi...@apache.org.
FLEX-34088 Using addChild instead of addElement for FlexUnit to get the test to run.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/631b09c6
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/631b09c6
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/631b09c6
Branch: refs/heads/develop
Commit: 631b09c60a49af3dd96990f85ced677f51188d72
Parents: 3d71f1b
Author: Mihai Chira <mi...@apache.org>
Authored: Mon Sep 19 13:32:06 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Mon Sep 19 13:32:06 2016 +0200
----------------------------------------------------------------------
.../components/supportClasses/CalloutButton_FLEX_34088_Tests.as | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/631b09c6/frameworks/projects/spark/tests/spark/components/supportClasses/CalloutButton_FLEX_34088_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/tests/spark/components/supportClasses/CalloutButton_FLEX_34088_Tests.as b/frameworks/projects/spark/tests/spark/components/supportClasses/CalloutButton_FLEX_34088_Tests.as
index e084124..d1c68b3 100644
--- a/frameworks/projects/spark/tests/spark/components/supportClasses/CalloutButton_FLEX_34088_Tests.as
+++ b/frameworks/projects/spark/tests/spark/components/supportClasses/CalloutButton_FLEX_34088_Tests.as
@@ -62,7 +62,7 @@ package spark.components.supportClasses {
public function test_dropdown_doesnt_close_when_item_selected_from_DropDownList():void
{
//given
- UIImpersonator.addElement(_sut);
+ UIImpersonator.addChild(_sut);
//when
_sut.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OVER));