New issue
Advanced search Search tips

Issue 655167 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Consider adding StrictMode checks to WebView shell

Project Member Reported by gsennton@chromium.org, Oct 12 2016

Issue description

We've added an instrumentation test for checking Strictmode violations on WebView startup in https://codereview.chromium.org/2337983004
Since the instrumentation doesn't use the real WebView loading code-path that test might miss some violations.
To catch StrictMode violations during development and in certain WebView tests we could turn on Strictmode violations in our WebView Shell (the instrumentation test will still be useful since it is being run on the CQ).
 
We should probably also consider running webview shell tests and/or instrumentation tests in a release-built setting (to enable proguard), not sure if that makes sense for instrumentation tests (since use a different build target than the webview apk itself).
Owner: ----
Status: Available (was: Assigned)
I haven't looked at this since I filed it, putting it in the list of available WebView bugs.
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 15 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: paulmiller@chromium.org
Status: Assigned (was: Untriaged)
This sounds easy.

I see in the test, though, it does:

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
        .detectAll()
        .penaltyLog()
        .penaltyDeath()
        .build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
        .detectAll()
        .penaltyLog()
        .penaltyDeath()
        .build());

Doesn't that mean *no* thread can do I/O? We definitely do I/O in the background on startup. I guess we just want the ThreadPolicy part?

Also, in https://codereview.chromium.org/2337983004/patch/80001/90004, there should probably be a try/finally.

Comment 5 by torne@chromium.org, Jun 15 2018

VmPolicy controls a bunch of *other* things, distinct to the set in ThreadPolicy: leaked global resources, discouraged uses of reflection, etc. We probably do want all of those turned on; it's not "the same things but applied to all threads".
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 18 2018

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

commit 56a6262f1826f71e8426642a498bc0bca92cebbb
Author: Paul Miller <paulmiller@google.com>
Date: Mon Jun 18 19:48:39 2018

Enable StrictMode in WebView shell

BUG= 655167 

Change-Id: I2b18f52fae92993f1e37852924d8cbaf19872eaf
Reviewed-on: https://chromium-review.googlesource.com/1103395
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Paul Miller <paulmiller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568115}
[modify] https://crrev.com/56a6262f1826f71e8426642a498bc0bca92cebbb/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java

Status: Fixed (was: Assigned)

Sign in to add a comment