Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

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.

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.


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
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants