weblayer: Make public java API mock-able
For classes that are reasonable to be mocked in tests, ensure they are not final and has a constructor that do not initialize or use weblayer implementation in any way. The constructor does not ensure the object is in a valid state and it's up to the test to mock out all methods and not rely on any method call to work. BrowserFragment is still final. It's not really part of the public interface and tests should profile its own Fragment mocks. UrlBarOptions is still final. It does not access weblayer internals and tests can ignore the options and create its own UrlBar mock. Fixed: 1050428 Change-Id: I716bbb4c51df0a86aefc1cd8aeb57622f595a5e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2045174Reviewed-by:John Abd-El-Malek <jam@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Commit-Queue: Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#740117}
Showing
Please register or sign in to comment