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.
|
||||
// NOTE: Don't replace this with forceGC();
|
||||
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();
|
||||
|
||||
try {
|
||||
TKUnit.assert(!weakRef.get(), weakRef.get() + " leaked!");
|
||||
done(null);
|
||||
|
||||
@@ -200,7 +200,7 @@ if (isIOS) {
|
||||
helper.buildUIAndRunTest(_createTextFieldFunc(), function (views: Array<View>) {
|
||||
var textField = <TextField>views[0];
|
||||
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");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user