mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(tests): Sporadic failures after upgrade to WebKit 12.0 (#6635)
* An additional GC and wait are needed since WebKit upgrade to version 12.0 (TEXT-FIELD.testMemoryLeak test started failing sporadically) * Compare colors by value because the runtime has started to sometimes return instances with different addresses in memory
This commit is contained in:
committed by
Dimitar Topuzov
parent
25c99d8f71
commit
65e3a19f8c
@@ -150,9 +150,13 @@ export function buildUIWithWeakRefAndInteract<T extends View>(createFunc: () =>
|
|||||||
// Could cause GC on the next call.
|
// Could cause GC on the next call.
|
||||||
// NOTE: Don't replace this with forceGC();
|
// NOTE: Don't replace this with forceGC();
|
||||||
new ArrayBuffer(4 * 1024 * 1024);
|
new ArrayBuffer(4 * 1024 * 1024);
|
||||||
|
|
||||||
|
// An additional GC and wait are needed since WebKit upgrade to version 12.0
|
||||||
|
// (TEXT-FIELD.testMemoryLeak test started failing sporadically)
|
||||||
|
utils.GC();
|
||||||
|
TKUnit.wait(0.1);
|
||||||
}
|
}
|
||||||
utils.GC();
|
utils.GC();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TKUnit.assert(!weakRef.get(), weakRef.get() + " leaked!");
|
TKUnit.assert(!weakRef.get(), weakRef.get() + " leaked!");
|
||||||
done(null);
|
done(null);
|
||||||
@@ -683,13 +687,13 @@ function setupSetters(): void {
|
|||||||
cssSetters.set("selectedTabTextColor", "red");
|
cssSetters.set("selectedTabTextColor", "red");
|
||||||
cssSetters.set("androidSelectedTabHighlightColor", "red");
|
cssSetters.set("androidSelectedTabHighlightColor", "red");
|
||||||
|
|
||||||
// ListView-specific props
|
// ListView-specific props
|
||||||
cssSetters.set("separatorColor", "red");
|
cssSetters.set("separatorColor", "red");
|
||||||
|
|
||||||
// SegmentedBar-specific props
|
// SegmentedBar-specific props
|
||||||
cssSetters.set("selectedBackgroundColor", "red");
|
cssSetters.set("selectedBackgroundColor", "red");
|
||||||
|
|
||||||
// Page-specific props
|
// Page-specific props
|
||||||
cssSetters.set("statusBarStyle", "light");
|
cssSetters.set("statusBarStyle", "light");
|
||||||
cssSetters.set("androidStatusBarBackground", "red");
|
cssSetters.set("androidStatusBarBackground", "red");
|
||||||
|
|
||||||
@@ -855,4 +859,4 @@ function setupSetters(): void {
|
|||||||
return text ? text.toString() : text;
|
return text ? text.toString() : text;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ if (isIOS) {
|
|||||||
helper.buildUIAndRunTest(_createTextFieldFunc(), function (views: Array<View>) {
|
helper.buildUIAndRunTest(_createTextFieldFunc(), function (views: Array<View>) {
|
||||||
var textField = <TextField>views[0];
|
var textField = <TextField>views[0];
|
||||||
textField.color = new Color("red");
|
textField.color = new Color("red");
|
||||||
TKUnit.assertEqual(textField.color.ios.CGColor, textField.ios.textColor.CGColor, "textField.color");
|
TKUnit.assert(textField.color.ios.CGColor.isEqual(textField.ios.textColor.CGColor), "textField.color");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -633,7 +633,7 @@ export function test_android_ime_actions_move_focus() {
|
|||||||
if (isIOS) {
|
if (isIOS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const stack = new StackLayout();
|
const stack = new StackLayout();
|
||||||
const addTextField = () => {
|
const addTextField = () => {
|
||||||
const tf = new TextField();
|
const tf = new TextField();
|
||||||
@@ -655,7 +655,7 @@ export function test_android_ime_actions_move_focus() {
|
|||||||
|
|
||||||
let edittext = stack._context.getCurrentFocus();
|
let edittext = stack._context.getCurrentFocus();
|
||||||
TKUnit.assertNotNull(edittext, "TextField not focused.");
|
TKUnit.assertNotNull(edittext, "TextField not focused.");
|
||||||
|
|
||||||
edittext.onEditorAction(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT);
|
edittext.onEditorAction(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT);
|
||||||
assert(0, 1);
|
assert(0, 1);
|
||||||
assert(1, 0);
|
assert(1, 0);
|
||||||
@@ -691,4 +691,4 @@ export function test_android_ime_actions_move_focus() {
|
|||||||
assert(1, 2);
|
assert(1, 2);
|
||||||
assert(2, 2);
|
assert(2, 2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user