New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 826056 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Handle javascript dialogs in WebView test shells

Project Member Reported by jamwalla@chromium.org, Mar 26 2018

Issue description

There are four types of javascript dialogs:

1) prompt()
2) alert()
3) confirm()
4) beforeunload()

We should handle these dialogs in WebView's test shells.

I found this article: Chromium policy on JavaScript dialogs https://developers.google.com/web/updates/2017/03/dialogs-policy

1-3 are straightforward; 4 looks more complicated, but then this is the test shell so we don't need to be as robust as chrome.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3185f133384bcb1d257b26637ef045d85810bfd

commit c3185f133384bcb1d257b26637ef045d85810bfd
Author: James Wallace-Lee <jamwalla@chromium.org>
Date: Tue Apr 03 23:26:12 2018

Add Window.confirm handling to webview shells

Show an Android Alert Dialog when Window.confirm is called in javascript
in webview test shells.

Bug:  826056 
Change-Id: Ic5e279e26719a3b73fa8cc88393344111e33baeb
Reviewed-on: https://chromium-review.googlesource.com/981201
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Commit-Queue: James Wallace-Lee <jamwalla@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547866}
[modify] https://crrev.com/c3185f133384bcb1d257b26637ef045d85810bfd/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java

Please add the verification steps so we can verify this issue
webview_instrumentation_apk should show appropriate dialogs (compare to chrome or system_webview_shell) on the following pages:
https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert
https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm
https://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt

Comment 4 by boliu@chromium.org, Apr 10 2018

Wait.. this is in the instrumentation shell, not the webview test shell? No one *manually* uses the instrumentation shell for anything (except checking for webgl behavior)
oh.. yeah, I came across this working on the webgl stuff, and then found out the webview test shell already had this implemented. should we close this?

Comment 6 by boliu@chromium.org, Apr 10 2018

Status: Fixed (was: Assigned)
ahh, ok, yeah can close this now

for test team: this is a change to a test shell. there is no change to production webview, so there is nothing to test

Sign in to add a comment