About fortesting method

37 views
Skip to first unread message

Tao Bai

unread,
Jun 12, 2020, 3:55:44 PM6/12/20
to binar...@chromium.org
I add a getAutofillPopupForTesting() in patch to indicate that it can only be used by test, and verified there is no product code invoked it, then put the "Binary-Size: The ForTest method isn't called in production code. " in the CL description, but still got the check failed.

What should I do?

- Michael

Andrew Grieve

unread,
Jun 12, 2020, 4:26:44 PM6/12/20
to Tao Bai, binary-size
I think the best way to investigate why the method is not being removed is to use ProGuard's -whyareyoukeeping

e.g. Add to //base/android/proguard/chromium_apk.flags:

-whyareyoukeeping class  org.chromium.components.autofill.AutofillProviderImpl {
  ** getAutofillPopupForTesting();
}

And then rebuild monochrome_public_bundle.

It should tell you why R8 is not removing the method.

--
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CAD48xCt7Mv5%3DugJ5h8utPfcKA0EhmE4EhEhbKgn%3DPNR2uyzW4g%40mail.gmail.com.

Tao Bai

unread,
Jun 12, 2020, 7:49:09 PM6/12/20
to Andrew Grieve, binary-size
Here is the output, not quite actionable, how do I get more output, like enable -verbose

In ../../base/android/proguard/chromium_apk.flags:
  Ignoring option: -optimizations
org.chromium.components.autofill.AutofillProviderImpl
|- is referenced in keep rule:
|  ../../base/android/proguard/chromium_code.flags:73:1
org.chromium.components.autofill.AutofillPopup org.chromium.components.autofill.AutofillProviderImpl.getAutofillPopupForTesting()
|- is referenced in keep rule:
|  ../../base/android/proguard/chromium_code.flags:73:1
InnerClasses attribute has entries missing a corresponding EnclosingMethod attribute. Such InnerClasses attribute entries are ignored.
In lib.java/clank/third_party/chime/chime_sdk_java.jar:com/google/c/d/a/chma$chma.class:


- Michael

Andrew Grieve

unread,
Jun 12, 2020, 8:24:27 PM6/12/20
to Tao Bai, Andrew Grieve, binary-size
Ah, okay, I think these DoNotInline rules are missing ",allowshrinking":

Can you try adding that?

Tao Bai

unread,
Jun 12, 2020, 9:48:50 PM6/12/20
to Andrew Grieve, binary-size
Yes, it works. Do you want me to prepare the patch?
- Michael

Andrew Grieve

unread,
Jun 12, 2020, 10:06:35 PM6/12/20
to Tao Bai, Andrew Grieve, binary-size
Yes, please! 
Reply all
Reply to author
Forward
0 new messages