-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Adding first semantics perf test #10649
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
yjbanov
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.
|
|
||
| test('inital tree creation', () async { | ||
| // Let app become fully idle. | ||
| await new Future<Null>.delayed(new Duration(seconds: 1)); |
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.
I think calling driver.waitFor would be more robust than waiting for a magical amount of time, as waitFor ensures there's nothing going on in the app.
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.
I can't find any element to wait for, though. Shortly after app app loads the dimensions of some elements change, but I don't see a way to robustly wait for that...
| import 'package:flutter_devicelab/framework/utils.dart'; | ||
| import 'package:path/path.dart' as p; | ||
|
|
||
| void main() { |
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.
You might need to set the device OS like so
| String workingDirectory, | ||
| }) async { | ||
| final Process process = await startProcess(executable, arguments, environment: environment); | ||
| final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory); |
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.
Consider using inDirectory instead.
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.
Nice!
| _semantics.dispose(); | ||
| _semantics = null; | ||
| } | ||
| final bool enabled = RendererBinding.instance.pipelineOwner.semanticsOwner != null; |
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: since the other variable is called wasEnabled, perhaps this one should be called isEnabled. But also, you could make the expression into a getter, then you wouldn't need a second variable:
bool get isEnabled => RendererBinding.instance.pipelineOwner.semanticsOwner != null;
bool wasEnabled = isEnabled;
...
return new SetSemanticsResult(wasEnabled != isEnabled);| String get kind; | ||
|
|
||
| /// Serializes this command to parameter name/value pairs. | ||
| @mustCallSuper |
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.
\o/
|
|
||
| import 'message.dart'; | ||
|
|
||
| /// Enables or disables Semantics. |
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: when I see capitalized words in plain English text I immediately think it's either a proper noun or a reference to a type. I'm guessing this is not a proper noun, but if it's a type, consider backquoting it: Semantics vs Semantics.
Measures the duration of building the initial semantics tree for the complex_layout app.