Skip to content

Conversation

@goderbauer
Copy link
Member

Measures the duration of building the initial semantics tree for the complex_layout app.

@goderbauer goderbauer requested a review from yjbanov June 13, 2017 01:02
Copy link
Contributor

@yjbanov yjbanov left a 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));
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 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.

Copy link
Member Author

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

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

Choose a reason for hiding this comment

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

Consider using inDirectory instead.

Copy link
Member Author

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

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

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

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.

@goderbauer goderbauer merged commit 8bf1719 into flutter:master Jun 13, 2017
@goderbauer goderbauer deleted the addSemanticsPerfTest branch June 13, 2017 19:49
@goderbauer goderbauer added the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Oct 17, 2017
@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

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants