patch 8.1.2288: not using all space when popup with "topleft" flips to above

Problem:    Not using all space when popup with "topleft" flips to above.
Solution:   Recompute the height when a popup flips from below to above.
            (closes #5151)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index ed4a775..ad3caa0 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -389,9 +389,9 @@
 	      \ border: [],
 	      \ })
 	" cursor in a line in top half, using "topleft" with popup that
-	" doesn't fit and "posinvert" set: flips to below.
+	" doesn't fit and "posinvert" set: flips to above.
 	normal 8G44|r%
-	let winid1 = popup_create(['one', 'two', 'tee'], #{
+	let winid1 = popup_create(['one', 'two', 'tee', 'fou', 'fiv'], #{
 	      \ line: 'cursor+1',
 	      \ col: 'cursor',
 	      \ pos: 'topleft',