add profile for functions, profile CSS-es on startup, use __time (#4227)

Call native setters once when a page is instantiated.

Fix background not being reset, Label's background is now set to background, not layer

Make the nativeView field instead of property for performance reasons
This commit is contained in:
Panayot Cankov
2017-06-08 09:51:09 +03:00
committed by GitHub
parent ce01ab597f
commit 014e7a8e0f
30 changed files with 654 additions and 284 deletions

View File

@@ -224,6 +224,8 @@ var _testNativeBackgroundColorFromCss = function (views: Array<viewModule.View>)
var page = <pagesModule.Page>views[1];
page.css = "button { background-color: " + actualBackgroundColorHex + "; }";
helper.waitUntilLayoutReady(button);
var actualResult = buttonTestsNative.getNativeBackgroundColor(button).hex;
TKUnit.assert(actualResult === expectedNormalizedBackgroundColorHex, "Actual: " + actualResult + "; Expected: " + expectedNormalizedBackgroundColorHex);
}
@@ -232,6 +234,8 @@ var _testNativeBackgroundColorFromLocal = function (views: Array<viewModule.View
var button = <buttonModule.Button>views[0];
button.style.backgroundColor = new colorModule.Color(actualBackgroundColorHex);
helper.waitUntilLayoutReady(button);
var actualResult = buttonTestsNative.getNativeBackgroundColor(button).hex;
TKUnit.assert(actualResult === expectedNormalizedBackgroundColorHex, "Actual: " + actualResult + "; Expected: " + expectedNormalizedBackgroundColorHex);
}
@@ -267,6 +271,8 @@ export var test_StateHighlighted_also_fires_pressedState = function () {
var expectedNormalizedColor = "#FF0000";
page.css = "button:pressed { background-color: " + expectedColor + "; }";
helper.waitUntilLayoutReady(view);
view._goToVisualState('highlighted');
var actualResult = buttonTestsNative.getNativeBackgroundColor(view);
@@ -282,6 +288,8 @@ export var test_StateHighlighted_also_fires_activeState = function () {
var expectedNormalizedColor = "#FF0000";
page.css = "button:active { background-color: " + expectedColor + "; }";
helper.waitUntilLayoutReady(view);
view._goToVisualState('highlighted');
var actualResult = buttonTestsNative.getNativeBackgroundColor(view);
@@ -297,6 +305,8 @@ export var test_applying_disabled_visual_State_when_button_is_disable = function
var expectedNormalizedColor = "#FF0000";
page.css = "button:disabled { background-color: " + expectedColor + "; }";
helper.waitUntilLayoutReady(view);
view.isEnabled = false;
var actualResult = buttonTestsNative.getNativeBackgroundColor(view);