-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Refactoring the Android_views tests app to prepare for adding the iOS platform view tests #36200
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
Conversation
| const Page(this.title, this.valueKey); | ||
|
|
||
| final String title; | ||
| final ValueKey<String> valueKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming back here after reading the test code now I see, document it though.
|
|
||
| import 'package:flutter/material.dart'; | ||
|
|
||
| abstract class Page extends StatelessWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document
| test('recomposition', () async { | ||
| if (Platform.isAndroid) { | ||
| final SerializableFinder linkToOpenMotionEventPage = | ||
| find.byValueKey('MotionEventPage'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this should say MotionEventsListTile
| final SerializableFinder linkToOpenMotionEventPage = | ||
| find.byValueKey('MotionEventPage'); | ||
| await driver.tap(linkToOpenMotionEventPage); | ||
| await driver.waitFor(find.byValueKey('MotionEventPageLoaded')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this key after the element it's used for.
|
|
||
| const String kEventsFileName = 'touchEvents'; | ||
|
|
||
| class MotionEventPage extends Page { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: MotionEventsPage
| RaisedButton( | ||
| key: const ValueKey<String>('play'), | ||
| child: const Text('PLAY FILE'), | ||
| onPressed: () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid reformatting the previous code if the previous formatting is good. (in multiple places)
| void diffPointerCoords(Map<String, dynamic> expected, | ||
| Map<String, dynamic> actual, int pointerIdx, StringBuffer diffBuffer) { | ||
| diffMaps(expected, actual, diffBuffer, messagePrefix: '[pointerCoord $pointerIdx] '); | ||
| diffMaps(expected, actual, diffBuffer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid unneeded reformatting
|
@amirh Updated. Ready for another review. |
amirh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM module nits and renaming motion_event_page.dart to motion_events_page.dart
| } | ||
| for (String key in expected.keys) { | ||
| if (excludeKeys.contains(key)) | ||
| if (excludeKeys.contains(key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove extra space
|
|
||
| class MotionEventsPage extends Page { | ||
| const MotionEventsPage() | ||
| : super('Place circle', const ValueKey<String>('MotionEventsListTile')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place circle?
| if (excludeKeys.contains(key)) | ||
| continue; | ||
| if (doublesApproximatelyMatch(expected[key], actual[key])) | ||
| if (doublesApproximatelyMatch(expected[key], actual[key])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
|
Updated! |
… platform view tests (flutter#36200) This PR created a main page for platform view tests in the android views testing app. The main page none contains a list of the links to the pages being tested. It puts the android view motion events tests to a sub page. The PR also added iOS related files to get ready for adding the iOS platform views tests.
Description
This PR created a main page for platform view tests in the android views testing app. The main page none contains a list of the links to the pages being tested. It puts the android view motion events tests to a sub page.
The PR also added iOS related files to get ready for adding the iOS platform views tests.
Following up:
Related Issues
Tests
I added the following tests:
No new tested added, modified the
recompositiontests with navigation taps.Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?