Changes for Chromium for Robolectric 3.2.
Rebasing modifications for Robolectric 3.0 onto Robolectric
3.2.2.
Additionally, adding back getContext() to the ContentProvider
shadow as it was used by one of our tests.
BUG=693659
R=yolandyan@chromium.org
Committed: 5244ef6a3a6aada84a7f4f270f253b760019c14c
https://codereview.appspot.com/319410043/diff/20001/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java File robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java (right): https://codereview.appspot.com/319410043/diff/20001/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java#newcode36 robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java:36: public final Context getContext() { Was there not a ...
8 years, 4 months ago
(2017-03-01 02:16:38 UTC)
#4
8 years, 4 months ago
(2017-03-01 03:25:00 UTC)
#6
On 2017/03/01 03:21:28, mikecase wrote:
>
https://codereview.appspot.com/319410043/diff/20001/robolectric-shadows/shado...
> File
>
robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java
> (right):
>
>
https://codereview.appspot.com/319410043/diff/20001/robolectric-shadows/shado...
>
robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowContentProvider.java:36:
> public final Context getContext() {
> On 2017/03/01 02:16:38, jbudorick wrote:
> > Was there not a better way to get the Context?
>
> Well, this function was in Robolectric 3.0 and is relied on by some of our
tests
> (3 tests to be exact)
>
>
https://github.com/robolectric/robolectric/blob/robolectric-3.0/robolectric-s...
>
> The test calls something that calls getContext(). So at minimum we would have
to
> disable or refactor the test. I could add a..
> # TODO(mikecase): Remove when no tests rely on this,
>
> or something
Also, ContentProvider getContext() is final. So we cant even mock it out. I
think we have to do it through a shadow.
Ok, so here is my plan. Undo my changes here to ShadowContentProvider.java and commit this. ...
8 years, 4 months ago
(2017-03-01 18:45:36 UTC)
#7
Ok, so here is my plan. Undo my changes here to ShadowContentProvider.java and
commit this.
Then override the ShadowContentProvider.java (MyShadowContentProvider.java or
something) for the one test class that needs the getContext() shadowed.
Then will add the author of that test to the review, verify it works as
expected, and hopefully commit the upgrade of Robolectric in Chromium.
On 2017/03/01 18:45:36, mikecase wrote: > Ok, so here is my plan. Undo my changes ...
8 years, 4 months ago
(2017-03-01 18:50:55 UTC)
#8
On 2017/03/01 18:45:36, mikecase wrote:
> Ok, so here is my plan. Undo my changes here to ShadowContentProvider.java and
> commit this.
>
> Then override the ShadowContentProvider.java (MyShadowContentProvider.java or
> something) for the one test class that needs the getContext() shadowed.
> Then will add the author of that test to the review, verify it works as
> expected, and hopefully commit the upgrade of Robolectric in Chromium.
Since I have lgtm from yoland, and this now literally only a rebase of what I
already have commit onto the 3.0-chromium branch. Going to commit now.
Issue 319410043: Changes for Chromium for Robolectric 3.2.
(Closed)
Created 8 years, 4 months ago by mikecase
Modified 8 years, 4 months ago
Reviewers: jbudorick, yolandyan
Base URL:
Comments: 2