| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,10 @@ import { Page } from "tns-core-modules/ui/page"; | |||
| 8 | 8 | import * as helper from "../helper"; | |
| 9 | 9 | import * as TKUnit from "../../TKUnit"; | |
| 10 | 10 | ||
| 11 | - const NAV_WAIT = 8; | ||
| 11 | + const NAV_WAIT = 15; | ||
| 12 | + function emptyNavigationQueue(frame: Frame) { | ||
| 13 | + TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 14 | + } | ||
| 12 | 15 | ||
| 13 | 16 | export function ignore_test_DummyTestForSnippetOnly0() { | |
| 14 | 17 | // >> frame-navigating | |
@@ -66,7 +69,7 @@ export function test_can_go_back() { | |||
| 66 | 69 | const frame = topmost(); | |
| 67 | 70 | ||
| 68 | 71 | frame.navigate({ create: () => new Page(), clearHistory: true }); | |
| 69 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty()); | ||
| 72 | + emptyNavigationQueue(frame); | ||
| 70 | 73 | ||
| 71 | 74 | frame.navigate(() => new Page()); | |
| 72 | 75 | frame.navigate(() => new Page()); | |
@@ -131,13 +134,14 @@ export function test_can_go_back() { | |||
| 131 | 134 | ||
| 132 | 135 | TKUnit.assertFalse(frame.canGoBack(), "14"); | |
| 133 | 136 | frame.goBack(); | |
| 134 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 137 | + | ||
| 138 | + emptyNavigationQueue(frame); | ||
| 135 | 139 | } | |
| 136 | 140 | ||
| 137 | 141 | export function test_go_back_to_backstack_entry() { | |
| 138 | 142 | const frame = topmost(); | |
| 139 | 143 | frame.navigate(() => new Page()); | |
| 140 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty()); | ||
| 144 | + emptyNavigationQueue(frame); | ||
| 141 | 145 | ||
| 142 | 146 | frame.navigate(() => new Page()); | |
| 143 | 147 | frame.navigate(() => new Page()); | |
@@ -149,7 +153,7 @@ export function test_go_back_to_backstack_entry() { | |||
| 149 | 153 | ||
| 150 | 154 | TKUnit.assertFalse(frame.canGoBack(), "2"); | |
| 151 | 155 | frame.goBack(); | |
| 152 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 156 | + emptyNavigationQueue(frame); | ||
| 153 | 157 | } | |
| 154 | 158 | ||
| 155 | 159 | export function test_page_parent_when_backstackVisible_is_false() { | |
@@ -165,7 +169,7 @@ export function test_page_parent_when_backstackVisible_is_false() { | |||
| 165 | 169 | frame.navigate({ create: () => new Page(), clearHistory: true }); | |
| 166 | 170 | frame.navigate({ create, backstackVisible: false }); | |
| 167 | 171 | frame.navigate(() => new Page()); | |
| 168 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 172 | + emptyNavigationQueue(frame); | ||
| 169 | 173 | ||
| 170 | 174 | TKUnit.assertEqual(pages.length, 1); | |
| 171 | 175 | TKUnit.assertEqual(frame.backStack.length, 1); | |
@@ -191,7 +195,7 @@ export function test_page_parent_when_navigate_with_clear_history() { | |||
| 191 | 195 | frame.navigate({ create, backstackVisible: false }); | |
| 192 | 196 | frame.navigate({ create }); | |
| 193 | 197 | frame.navigate({ create: () => new Page(), clearHistory: true }); | |
| 194 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 198 | + emptyNavigationQueue(frame); | ||
| 195 | 199 | ||
| 196 | 200 | TKUnit.assertEqual(pages.length, 3); | |
| 197 | 201 | TKUnit.assertEqual(frame.backStack.length, 0); | |
@@ -216,7 +220,7 @@ export function test_page_parent_when_navigate_back() { | |||
| 216 | 220 | frame.navigate({ create: () => new Page(), clearHistory: true }); | |
| 217 | 221 | frame.navigate({ create }); | |
| 218 | 222 | frame.goBack(); | |
| 219 | - TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT); | ||
| 223 | + emptyNavigationQueue(frame); | ||
| 220 | 224 | ||
| 221 | 225 | TKUnit.assertEqual(pages.length, 1); | |
| 222 | 226 | TKUnit.assertEqual(frame.backStack.length, 0); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments