Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Jul 19, 2017

No description provided.

@Hixie
Copy link
Contributor Author

Hixie commented Jul 19, 2017

cc @yjbanov for review since most of this is devicelab and driver changes to support the test of the actual feature which is just a dozen lines or so. :-)

@Hixie Hixie force-pushed the performance-overlay branch from 24d311b to 9c13afb Compare July 19, 2017 16:15
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

Choose a reason for hiding this comment

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

nit: update year.

Copy link
Member

Choose a reason for hiding this comment

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

license headers? Here and below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to all files in this directory

Copy link
Contributor

Choose a reason for hiding this comment

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

I think test increases the number of tests interacting with tools' std streams from 1 to 2. Perhaps it's time we created a utility library for these kinds of tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's not that much in common. A future version of commands_test will probably further test the output to make sure we're logging the right messages when pressing keys, for example.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is const Duration() == Duration.ZERO? If so, I'd use Duration.ZERO instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh right, good call.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: wrap "String" and "int" in backticks: String, int.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hyperlinked

Copy link
Contributor

Choose a reason for hiding this comment

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

isEmpty?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I think you don't need the if block at all. _waitForAbsentElement returns iff Finder.precache returns false, which means it found nothing. Otherwise, we rely on the timeout logic. So this method can be simplified to:

final WaitForAbsent waitForAbsentCommand = command;
await _waitForAbsentElement(_createFinder(waitForAbsentCommand.finder));
return new WaitForAbsentResult();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

My intuition tells me that this should throw.

@Hixie Hixie force-pushed the performance-overlay branch from 9c13afb to fc2178d Compare July 19, 2017 19:27
@Hixie
Copy link
Contributor Author

Hixie commented Jul 19, 2017

will land on green

@Hixie Hixie merged commit e1adc52 into flutter:master Jul 19, 2017
@Hixie Hixie deleted the performance-overlay branch July 19, 2017 19:57
@tvolkert
Copy link
Contributor

Tried to use this inside Google today, and getting incorrect behavior:

  • If I call await driver.waitForAbsent(find.text('foo'), timeout: const Duration(seconds: 20)), the future never completes, and the test fails with a timeout exception

  • If I first await a delayed future of 6 seconds to let the Snackbar that holds the text go away, then run the await above, then the future completes just fine, and the test succeeds.

@tvolkert
Copy link
Contributor

The future is never completing because of an error during this call:

await _waitUntilFrame(() => !finder.precache());

The error is:

'package:flutter_test/src/finders.dart': Failed assertion: line 269: '_cachedResult == null': is not true.

@Hixie
Copy link
Contributor Author

Hixie commented Jul 20, 2017

please file a bug

@tvolkert
Copy link
Contributor

#11327

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants