Skip to content

Commit 65e3a19

Browse files
mbektchievdtopuzov
authored andcommitted
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
1 parent 25c99d8 commit 65e3a19

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎tests/app/ui/helper.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ export function buildUIWithWeakRefAndInteract<T extends View>(createFunc: () =>
150150
// Could cause GC on the next call.
151151
// NOTE: Don't replace this with forceGC();
152152
new ArrayBuffer(4 * 1024 * 1024);
153+
154+
// An additional GC and wait are needed since WebKit upgrade to version 12.0
155+
// (TEXT-FIELD.testMemoryLeak test started failing sporadically)
156+
utils.GC();
157+
TKUnit.wait(0.1);
153158
}
154159
utils.GC();
155-
156160
try {
157161
TKUnit.assert(!weakRef.get(), weakRef.get() + " leaked!");
158162
done(null);
@@ -683,13 +687,13 @@ function setupSetters(): void {
683687
cssSetters.set("selectedTabTextColor", "red");
684688
cssSetters.set("androidSelectedTabHighlightColor", "red");
685689

686-
// ListView-specific props
690+
// ListView-specific props
687691
cssSetters.set("separatorColor", "red");
688692

689693
// SegmentedBar-specific props
690694
cssSetters.set("selectedBackgroundColor", "red");
691695

692-
// Page-specific props
696+
// Page-specific props
693697
cssSetters.set("statusBarStyle", "light");
694698
cssSetters.set("androidStatusBarBackground", "red");
695699

@@ -855,4 +859,4 @@ function setupSetters(): void {
855859
return text ? text.toString() : text;
856860
}
857861
});
858-
}
862+
}

‎tests/app/ui/text-field/text-field-tests.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ if (isIOS) {
200200
helper.buildUIAndRunTest(_createTextFieldFunc(), function (views: Array<View>) {
201201
var textField = <TextField>views[0];
202202
textField.color = new Color("red");
203-
TKUnit.assertEqual(textField.color.ios.CGColor, textField.ios.textColor.CGColor, "textField.color");
203+
TKUnit.assert(textField.color.ios.CGColor.isEqual(textField.ios.textColor.CGColor), "textField.color");
204204
});
205205
}
206206
}
@@ -633,7 +633,7 @@ export function test_android_ime_actions_move_focus() {
633633
if (isIOS) {
634634
return;
635635
}
636-
636+
637637
const stack = new StackLayout();
638638
const addTextField = () => {
639639
const tf = new TextField();
@@ -655,7 +655,7 @@ export function test_android_ime_actions_move_focus() {
655655

656656
let edittext = stack._context.getCurrentFocus();
657657
TKUnit.assertNotNull(edittext, "TextField not focused.");
658-
658+
659659
edittext.onEditorAction(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT);
660660
assert(0, 1);
661661
assert(1, 0);
@@ -691,4 +691,4 @@ export function test_android_ime_actions_move_focus() {
691691
assert(1, 2);
692692
assert(2, 2);
693693
});
694-
}
694+
}

0 commit comments

Comments
 (0)