Skip to content

Conversation

@cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Jul 15, 2019

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:

  1. A PR to rename the app to platform_views.
  2. A PR to add the platform views mutation screenshot tests.

Related Issues

Tests

I added the following tests:

No new tested added, modified the recomposition tests 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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Jul 15, 2019
@cyanglaz cyanglaz requested a review from amirh July 15, 2019 18:04
@cyanglaz cyanglaz added a: platform-views Embedding Android/iOS views in Flutter apps a: tests "flutter test", flutter_test, or one of our tests labels Jul 15, 2019
const Page(this.title, this.valueKey);

final String title;
final ValueKey<String> valueKey;
Copy link
Contributor

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?

Copy link
Contributor

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 {
Copy link
Contributor

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');
Copy link
Contributor

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'));
Copy link
Contributor

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 {
Copy link
Contributor

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: () {
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid unneeded reformatting

@cyanglaz
Copy link
Contributor Author

@amirh Updated. Ready for another review.

Copy link
Contributor

@amirh amirh left a 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))
Copy link
Contributor

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'));
Copy link
Contributor

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]))
Copy link
Contributor

Choose a reason for hiding this comment

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

here as well

@cyanglaz
Copy link
Contributor Author

Updated!

@cyanglaz cyanglaz merged commit 6ef4e82 into flutter:master Jul 17, 2019
@cyanglaz cyanglaz deleted the platform_view_tests branch July 17, 2019 15:21
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
… 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.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: platform-views Embedding Android/iOS views in Flutter apps a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants