From 8535e5459a2405c95cff5f39662714909656e142 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Tue, 1 Aug 2017 14:48:16 +0300 Subject: [PATCH] Fix unitests on API <20 (#4624) * Fix unitests on API <20 * Fix tests for API >19. Previous commit breaks them --- tests/app/ui/helper.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/app/ui/helper.ts b/tests/app/ui/helper.ts index 6469bc9ba..242f79dc9 100644 --- a/tests/app/ui/helper.ts +++ b/tests/app/ui/helper.ts @@ -282,9 +282,13 @@ export function nativeView_recycling_test(createNew: () => View, createLayout?: layout.addChild(newer); layout.addChild(first); - if (first.typeName !== "SearchBar" && sdkVersion > 19) { + if (first.typeName !== "SearchBar") { // There are way too many differences in native methods for search-bar. - // There are too many methods that just throw for newly created views in API lvl 19 and 17 + // There are too many methods that just throw for newly created views in API lvl 19 and 17 + if (sdkVersion < 21) { + TKUnit.waitUntilReady(() => layout.isLayoutValid); + } + compareUsingReflection(newer, first); } @@ -311,7 +315,17 @@ function compareUsingReflection(recycledNativeView: View, newNativeView: View): || name === 'getId' || name === 'hasFocus' || name === 'isDirty' + || name === 'getLeft' + || name === 'getTop' + || name === 'getRight' + || name === 'getBottom' + || name === 'getWidth' + || name === 'getHeight' + || name === 'getX' + || name === 'getY' + || name.includes('getMeasured') || name === 'toString'; + if (skip || method.getParameterTypes().length > 0) { continue; }