mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user