Hixie 85689f1231 Make the Semantics code be a service.
Port the tests to use the new interface.
2016-02-01 12:57:47 -08:00

19 lines
663 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:sky_services/semantics/semantics.mojom.dart' as mojom;
class TestSemanticsListener implements mojom.SemanticsListener {
TestSemanticsListener() {
SemanticsNode.addListener(this);
}
final List<mojom.SemanticsNode> updates = <mojom.SemanticsNode>[];
updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
assert(!nodes.any((mojom.SemanticsNode node) => node == null));
updates.addAll(nodes);
updates.add(null);
}
}