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/08/17 16:17:40 UTC
[1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-33311
Correcting some typos in the asdoc.
Repository: flex-sdk
Updated Branches:
refs/heads/develop 347b08316 -> 98c9446c1
FLEX-33311 Correcting some typos in the asdoc.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/8bb90031
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/8bb90031
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/8bb90031
Branch: refs/heads/develop
Commit: 8bb90031f9cda5c39183c82659e7f2b609f6a494
Parents: 347b083
Author: Mihai Chira <mi...@apache.org>
Authored: Wed Aug 17 11:27:40 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Wed Aug 17 11:27:40 2016 +0200
----------------------------------------------------------------------
.../projects/spark/src/spark/layouts/ConstraintLayout.as | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/8bb90031/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as b/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as
index 64db42d..4953917 100644
--- a/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as
+++ b/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as
@@ -83,7 +83,7 @@ use namespace mx_internal;
* and <code>right</code> constraints.</li>
*
* <li>If the element has both <code>top</code> and <code>bottom</code> constraints,
- * it's height is set to be the container's height minus the <code>top</code>
+ * it's height is set to be the container's height minus the <code>top</code>
* and <code>bottom</code> constraints.</li>
*
* <li>The element is set to its preferred width and/or height.</li>
@@ -96,12 +96,12 @@ use namespace mx_internal;
* the vertical direction such that its <code>baselinePosition</code> (usually the base line
* of its first line of text) is aligned with <code>baseline</code> constraint.</li>
*
- * <li>If element's <code>top</code> or <code>left</code> constraints
+ * <li>If element's <code>top</code> or <code>left</code> constraints
* are specified, then the element is
* positioned such that the top-left corner of the element's layout bounds is
* offset from the top-left corner of the container by the specified values.</li>
*
- * <li>If element's <code>bottom</code> or <code>right</code> constraints are specified,
+ * <li>If element's <code>bottom</code> or <code>right</code> constraints are specified,
* then the element is positioned such that the bottom-right corner
* of the element's layout bounds is
* offset from the bottom-right corner of the container by the specified values.</li>
[2/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-33311 Adding
unit test to reproduce the bug. Currently fails, as expected.
Posted by mi...@apache.org.
FLEX-33311 Adding unit test to reproduce the bug. Currently fails, as expected.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/98c9446c
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/98c9446c
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/98c9446c
Branch: refs/heads/develop
Commit: 98c9446c123749179ed3fee35e31e284a17ac8c6
Parents: 8bb9003
Author: Mihai Chira <mi...@apache.org>
Authored: Wed Aug 17 18:17:07 2016 +0200
Committer: Mihai Chira <mi...@apache.org>
Committed: Wed Aug 17 18:17:07 2016 +0200
----------------------------------------------------------------------
.../ConstraintLayout_FLEX_33311_Tests.as | 139 +++++++++++++++++++
1 file changed, 139 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/98c9446c/frameworks/projects/spark/tests/spark/layouts/ConstraintLayout_FLEX_33311_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/tests/spark/layouts/ConstraintLayout_FLEX_33311_Tests.as b/frameworks/projects/spark/tests/spark/layouts/ConstraintLayout_FLEX_33311_Tests.as
new file mode 100644
index 0000000..9a3d4ce
--- /dev/null
+++ b/frameworks/projects/spark/tests/spark/layouts/ConstraintLayout_FLEX_33311_Tests.as
@@ -0,0 +1,139 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.layouts {
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+
+ import mx.containers.utilityClasses.ConstraintColumn;
+ import mx.containers.utilityClasses.ConstraintRow;
+ import mx.effects.Resize;
+ import mx.states.SetProperty;
+ import mx.states.State;
+ import mx.states.Transition;
+
+ import org.flexunit.asserts.assertTrue;
+ import org.flexunit.async.Async;
+ import org.fluint.uiImpersonation.UIImpersonator;
+
+ import spark.components.DropDownList;
+ import spark.components.Group;
+ import spark.events.DropDownEvent;
+
+ public class ConstraintLayout_FLEX_33311_Tests {
+ private static const NO_ENTER_FRAMES_TO_ALLOW:int = 3;
+ private static var noEnterFramesRemaining:int = NaN;
+ private static const _finishNotifier:EventDispatcher = new EventDispatcher();
+
+ private var _sut:ConstraintLayout;
+ private var _parentGroup:Group;
+ private var _childGroup1:Group;
+ private var _childGroup2:Group;
+ private var _dropDown:DropDownList;
+
+ [Before]
+ public function setUp():void
+ {
+ _sut = new ConstraintLayout();
+ _sut.constraintColumns = new <ConstraintColumn>[new ConstraintColumn()];
+ var row:ConstraintRow = new ConstraintRow();
+ row.id = "row1";
+ _sut.constraintRows = new <ConstraintRow>[row];
+
+
+ _parentGroup = new Group();
+ _childGroup1 = new Group();
+ _childGroup2 = new Group();
+
+ _dropDown = new DropDownList();
+ _childGroup1.addElement(_dropDown);
+ _parentGroup.addElement(_childGroup1);
+ _parentGroup.addElement(_childGroup2);
+
+ _parentGroup.states = [
+ new State({name:"closed", overrides:[new SetProperty(_dropDown, "width", "200")]}),
+ new State({name:"open", overrides:[new SetProperty(_dropDown, "width", "400")]})];
+ _parentGroup.currentState = "closed";
+
+ var _transition:Transition = new Transition();
+ _transition.fromState = "*";
+ _transition.toState = "*";
+ _transition.effect = new Resize(_childGroup1);
+ _parentGroup.transitions = [_transition];
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ _sut = null;
+ _parentGroup = null;
+ _childGroup1 = null;
+ _childGroup2 = null;
+ _dropDown = null;
+ }
+
+ [Test(async, timeout=1000)]
+ public function reproduce_bug():void
+ {
+ function onDropDownOpen(event:DropDownEvent):void
+ {
+ _parentGroup.currentState = "open";
+ }
+
+ function onDropDownClose(event:DropDownEvent):void
+ {
+ _parentGroup.currentState = "closed";
+ }
+
+ //given
+ _childGroup1.baseline = "row1:0";
+ _childGroup2.baseline = "row1:0";
+ _dropDown.addEventListener(DropDownEvent.CLOSE, onDropDownClose);
+ _dropDown.addEventListener(DropDownEvent.OPEN, onDropDownOpen);
+
+ //when
+ _parentGroup.layout = _sut;
+ UIImpersonator.addElement(_parentGroup);
+ _dropDown.openDropDown();
+
+ //then - wait a few frames
+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
+ UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, then_no_fatal_was_thrown, 800);
+ }
+
+ private static function then_no_fatal_was_thrown(event:Event, passThroughData:Object):void
+ {
+ assertTrue(true);
+ }
+
+ private function onEnterFrame(event:Event):void
+ {
+ if(!--noEnterFramesRemaining)
+ {
+ UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
+ _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
+ }
+ else if(NO_ENTER_FRAMES_TO_ALLOW - noEnterFramesRemaining == 2)
+ {
+ _dropDown.closeDropDown(true);
+ }
+ }
+ }
+}
\ No newline at end of file