Commit cd16624
committed
Fix native crash and dialog-type assertion in WebView dialog tests
The instrumentation suite crashed the app process with SIGABRT during the
WebViewDialogOverrideTest teardown (a deferred g_object_unref on the WebKit main
loop while ActivityScenario destroyed the activity). The trigger is the new focus
wiring: onFocusChanged now calls wpe_view_focus_in, which keeps the page active and
scheduling engine work, while WebViewTestActivity never released the WebView, so the
leaked active page raced the activity teardown.
- WebViewTestActivity: release the WebView in onDestroy() so the focused/active page
is torn down deterministically per ActivityScenario recreation.
- WebView.destroy(): drop the platformView reference once the native WPEView has been
invalidated, so a late onFocusChanged during teardown cannot touch it.
- nativeScriptDialogConfirm: only call webkit_script_dialog_confirm_set_confirmed for
CONFIRM/BEFORE_UNLOAD dialogs (and set prompt text for PROMPT). Calling it for an
alert/prompt tripped a g_return_if_fail CRITICAL in WebKit.1 parent 0f595bc commit cd16624
3 files changed
Lines changed: 31 additions & 3 deletions
File tree
- wpeview/src
- androidTest/java/org/wpewebkit/wpeview
- main
- cpp/capi
- java/org/wpewebkit/wpeview
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
403 | 416 | | |
404 | 417 | | |
405 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| |||
0 commit comments