flutter_flutter/packages/flutter/test/rendering/test_semantics_client.dart
James Robinson a95c9fdb58 Isolate imports of generated Dart code from generated path (#5960)
This rewrites imports of various mojom.dart files from the Flutter
engine repo to instead import normal-looking dart files from the
(new) flutter_services package. This package handles exporting the
correct symbols from generated code wherever that may live.

Includes an engine roll to 3551e7a48e2e336777b15c7637af92fd7605b6c5
which contains the new flutter_services package.
2016-09-21 14:00:29 -07:00

26 lines
744 B
Dart

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/rendering.dart';
import 'package:flutter_services/semantics.dart' as mojom;
class TestSemanticsClient {
TestSemanticsClient(PipelineOwner pipelineOwner) {
_semanticsOwner = pipelineOwner.addSemanticsListener(_updateSemanticsTree);
}
SemanticsOwner _semanticsOwner;
void dispose() {
_semanticsOwner.removeListener(_updateSemanticsTree);
_semanticsOwner = null;
}
final List<mojom.SemanticsNode> updates = <mojom.SemanticsNode>[];
void _updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
updates.addAll(nodes);
}
}