Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Bump unit test robolectric version to 4.10.3 #42454

Merged
merged 11 commits into from Jun 2, 2023

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented May 31, 2023

Bumps robolectric version for unit tests to 4.10.3, the latest and greatest. Should support running unit tests with API 33.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

@@ -117,7 +117,6 @@ public void draw(Canvas canvas) {
verify(surface, times(1)).lockHardwareCanvas();
verify(surface, times(1)).unlockCanvasAndPost(canvas);
verifyNoMoreInteractions(surface);
verifyNoMoreInteractions(canvas);
Copy link
Contributor Author

@camsim99 camsim99 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer can be expected due to robolectric/robolectric#7279; there are now calls to draw that occur on canvas.


@Implements(Resources.class)
public class SplashShadowResources {
public class SplashShadowResources extends ShadowResources {
Copy link
Contributor Author

@camsim99 camsim99 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robolectric expects to find an extension of ShadowResources when @Implements(Resources.class) is specified, as per the docs.

@@ -780,7 +780,7 @@ public void disposeNullAndroidView() {
PlatformView platformView = mock(PlatformView.class);

Context context = ApplicationProvider.getApplicationContext();
View androidView = new View(context);
View androidView = mock(View.class);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the ApplicationProvider.getApplicationContext() context to create androidView is problematic because the call to attach in this method creates another View with the exact same context that is already added as a View to the relevant PlatformView, causing an error here.

@camsim99 camsim99 marked this pull request as ready for review June 1, 2023 18:45
Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I clicked update branch in addtion to approving this PR so that google testing can run.

@camsim99
Copy link
Contributor Author

camsim99 commented Jun 2, 2023

I clicked update branch in addtion to approving this PR so that google testing can run.

Google testing isn't running due to what seems like a sync error, but I'm not sure how this change would affect them. https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20linux_unopt/1394/overview and https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20linux_android_debug_engine/11000/overview are successful test runs.

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 2, 2023
@auto-submit auto-submit bot merged commit 4839761 into flutter:main Jun 2, 2023
27 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 2, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 2, 2023
…128147)

flutter/engine@b4250ac...f3f6a02

2023-06-02 jason-simmons@users.noreply.github.com Wrap concurrent message loop tasks in an autorelease pool on iOS/Mac platforms (flutter/engine#42459)
2023-06-02 godofredoc@google.com Update engine build config docs. (flutter/engine#41468)
2023-06-02 43054281+camsim99@users.noreply.github.com [Android] Bump unit test robolectric version to 4.10.3 (flutter/engine#42454)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jonahwilliams@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-android
Projects
None yet
4 participants