• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'message.dart';
6
7/// A Flutter Driver command that requests a string representation of the render tree.
8class GetRenderTree extends Command {
9  /// Create a command to request a string representation of the render tree.
10  const GetRenderTree({ Duration timeout }) : super(timeout: timeout);
11
12  /// Deserializes this command from the value generated by [serialize].
13  GetRenderTree.deserialize(Map<String, String> json) : super.deserialize(json);
14
15  @override
16  String get kind => 'get_render_tree';
17}
18
19/// A string representation of the render tree, the result of a
20/// [FlutterDriver.getRenderTree] method.
21class RenderTree extends Result {
22  /// Creates a [RenderTree] object with the given string representation.
23  const RenderTree(this.tree);
24
25  /// String representation of the render tree.
26  final String tree;
27
28  /// Deserializes the result from JSON.
29  static RenderTree fromJson(Map<String, dynamic> json) {
30    return RenderTree(json['tree']);
31  }
32
33  @override
34  Map<String, dynamic> toJson() => <String, dynamic>{
35    'tree': tree,
36  };
37}
38