import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; import * as TKUnit from "../../TKUnit"; import * as view from "tns-core-modules/ui/core/view"; import * as testModule from "../../ui-test"; import * as platform from "tns-core-modules/platform"; import { ios as iosUtils } from "tns-core-modules/utils/utils"; import * as helper from "../helper"; import { parse } from "tns-core-modules/ui/builder"; import { Page } from "tns-core-modules/ui/page"; import { Label } from "tns-core-modules/ui/label"; import { dipToDp, left, top, right, bottom, height, width, equal, closeEnough, lessOrCloseEnough, greaterOrCloseEnough, check, isLeftAlignedWith, isRightAlignedWith, isTopAlignedWith, isBottomAlignedWith, isLeftWith, isAboveWith, isRightWith, isBelowWith } from "./layout-tests-helper"; export class SafeAreaTests extends testModule.UITest { public create(): any { return null; } private executeSnippet(ui: U, setup: (ui: U) => void, test: (ui: U) => void, pageOptions?: helper.PageOptions): void { function waitUntilTestElementLayoutIsValid(view: view.View, timeoutSec?: number): void { TKUnit.waitUntilReady(() => { return view.isLayoutValid; }, timeoutSec || 1); } setup(ui); helper.buildUIAndRunTest(ui.root, () => { waitUntilTestElementLayoutIsValid(ui.root); test(ui); }, pageOptions); }; private noop() { // no operation }; public test_layout_changed_event_count() { const page = parse(` `); let gridLayoutChangedCounter = 0; let labelLayoutChangedCounter = 0; const grid = page.getViewById("grid"); grid.on(view.View.layoutChangedEvent, () => { gridLayoutChangedCounter++; }); const label =