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 2015/01/06 18:58:13 UTC
[3/5] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34625 moved
the unit test into the spark project,
as seems to be the pattern we're using with the apache project.
FLEX-34625 moved the unit test into the spark project, as seems to be the pattern we're using with the apache project.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/f244ed77
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/f244ed77
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/f244ed77
Branch: refs/heads/develop
Commit: f244ed77fc8658ec9c085cfbd19079783204bd57
Parents: 4e14e09
Author: Mihai Chira <mi...@apache.org>
Authored: Tue Jan 6 17:44:31 2015 +0000
Committer: Mihai Chira <mi...@apache.org>
Committed: Tue Jan 6 17:44:31 2015 +0000
----------------------------------------------------------------------
.../tests/spark/skins/spark/FLEX_34625_Tests.as | 109 +++++++++++++++++++
.../spark/skins/spark/FLEX_34625_Tests.as | 109 -------------------
2 files changed, 109 insertions(+), 109 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f244ed77/frameworks/projects/spark/src/tests/spark/skins/spark/FLEX_34625_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/tests/spark/skins/spark/FLEX_34625_Tests.as b/frameworks/projects/spark/src/tests/spark/skins/spark/FLEX_34625_Tests.as
new file mode 100644
index 0000000..070d987
--- /dev/null
+++ b/frameworks/projects/spark/src/tests/spark/skins/spark/FLEX_34625_Tests.as
@@ -0,0 +1,109 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.skins.spark {
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+
+ import mx.managers.FocusManager;
+ import mx.managers.IFocusManagerContainer;
+
+ import org.flexunit.asserts.assertTrue;
+ import org.flexunit.async.Async;
+ import org.fluint.uiImpersonation.UIImpersonator;
+
+ import spark.components.TextInput;
+
+ public class FLEX_34625_Tests {
+
+ private static const NO_ENTER_FRAMES_TO_ALLOW:int = 4;
+ private var noEnterFramesRemaining:int = NaN;
+ private var _finishNotifier:EventDispatcher;
+ private var _textInput:TextInput;
+
+ [Before]
+ public function setUp():void
+ {
+ var focusManager:FocusManager = new FocusManager(UIImpersonator.testDisplay as IFocusManagerContainer);
+ focusManager.showFocusIndicator = true;
+
+ _textInput = new TextInput();
+ _textInput.width = 0;
+ _textInput.height = 0;
+ _textInput.focusManager = focusManager;
+
+ _finishNotifier = new EventDispatcher();
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ _textInput = null;
+ _finishNotifier = null;
+ }
+
+ [Test(async, timeout=500)]
+ public function test_focus_skin_with_zero_focus_thickness():void
+ {
+ //given
+ UIImpersonator.addChild(_textInput);
+
+ //when
+ _textInput.setStyle("focusThickness", 0);
+ _textInput.setFocus();
+
+ //then wait for the focus skin to show
+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
+ UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, onTestComplete);
+ }
+
+ [Test(async, timeout=500)]
+ public function test_focus_skin_with_NaN_focus_thickness():void
+ {
+ //given
+ UIImpersonator.addChild(_textInput);
+
+ //when
+ _textInput.setStyle("focusThickness", NaN);
+ _textInput.setFocus();
+
+ //then wait for the focus skin to show
+ noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
+ UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ Async.handleEvent(this, _finishNotifier, Event.COMPLETE, onTestComplete);
+ }
+
+ private function onEnterFrame(event:Event):void
+ {
+ if(!--noEnterFramesRemaining)
+ {
+ UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
+
+ _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
+ }
+ }
+
+ private static function onTestComplete(event:Event, passThroughData:Object):void
+ {
+ //if we get here it means no error has been thrown
+ assertTrue(true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f244ed77/frameworks/tests/unitTests/spark/skins/spark/FLEX_34625_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/tests/unitTests/spark/skins/spark/FLEX_34625_Tests.as b/frameworks/tests/unitTests/spark/skins/spark/FLEX_34625_Tests.as
deleted file mode 100644
index 070d987..0000000
--- a/frameworks/tests/unitTests/spark/skins/spark/FLEX_34625_Tests.as
+++ /dev/null
@@ -1,109 +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 spark.skins.spark {
- import flash.events.Event;
- import flash.events.EventDispatcher;
-
- import mx.managers.FocusManager;
- import mx.managers.IFocusManagerContainer;
-
- import org.flexunit.asserts.assertTrue;
- import org.flexunit.async.Async;
- import org.fluint.uiImpersonation.UIImpersonator;
-
- import spark.components.TextInput;
-
- public class FLEX_34625_Tests {
-
- private static const NO_ENTER_FRAMES_TO_ALLOW:int = 4;
- private var noEnterFramesRemaining:int = NaN;
- private var _finishNotifier:EventDispatcher;
- private var _textInput:TextInput;
-
- [Before]
- public function setUp():void
- {
- var focusManager:FocusManager = new FocusManager(UIImpersonator.testDisplay as IFocusManagerContainer);
- focusManager.showFocusIndicator = true;
-
- _textInput = new TextInput();
- _textInput.width = 0;
- _textInput.height = 0;
- _textInput.focusManager = focusManager;
-
- _finishNotifier = new EventDispatcher();
- }
-
- [After]
- public function tearDown():void
- {
- _textInput = null;
- _finishNotifier = null;
- }
-
- [Test(async, timeout=500)]
- public function test_focus_skin_with_zero_focus_thickness():void
- {
- //given
- UIImpersonator.addChild(_textInput);
-
- //when
- _textInput.setStyle("focusThickness", 0);
- _textInput.setFocus();
-
- //then wait for the focus skin to show
- noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
- UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
- Async.handleEvent(this, _finishNotifier, Event.COMPLETE, onTestComplete);
- }
-
- [Test(async, timeout=500)]
- public function test_focus_skin_with_NaN_focus_thickness():void
- {
- //given
- UIImpersonator.addChild(_textInput);
-
- //when
- _textInput.setStyle("focusThickness", NaN);
- _textInput.setFocus();
-
- //then wait for the focus skin to show
- noEnterFramesRemaining = NO_ENTER_FRAMES_TO_ALLOW;
- UIImpersonator.testDisplay.addEventListener(Event.ENTER_FRAME, onEnterFrame);
- Async.handleEvent(this, _finishNotifier, Event.COMPLETE, onTestComplete);
- }
-
- private function onEnterFrame(event:Event):void
- {
- if(!--noEnterFramesRemaining)
- {
- UIImpersonator.testDisplay.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
-
- _finishNotifier.dispatchEvent(new Event(Event.COMPLETE));
- }
- }
-
- private static function onTestComplete(event:Event, passThroughData:Object):void
- {
- //if we get here it means no error has been thrown
- assertTrue(true);
- }
- }
-}