Commit 74292531 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android Refactor] Cleanup share target related JUnit tests

This CL is in preparation to adding logic in WebApkShareTargetUtil
which deals with androidx.browser.trusted.sharing.ShareTarget
(e.g. computing equality)

This CL:
1) Adds tests in WebApkInfoTest for:
  - invalid JSON in AndroidManifest in
org.chromium.webapk.shell_apk.shareParamNames <meta-data> key
  - building WebApkInfo.ShareData for Intent.EXTRA_STREAM
2) Refactors tests:
  - Introduces builder for WebApkInfo.ShareTarget This will simplify
    adding more tests
  - Replaces explicit references to WebApkShareTargetUtilShadow with
    WebApkShareTargetUtil. Robolectric magic changes references to
    WebApkShareTargetUtil to point to WebApkShareTargetUtilShadow
  - Introduces helper method createMinimalWebApkIntent() in
    WebApkTests to cut down on amount of boiler plate code.

BUG=997771

Change-Id: I47204c2fba3c4884685feb864d3b9da0f3b90664
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1766432
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695892}
parent bbe7ea0f
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment