• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2017 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 enables or disables the FrameSync mechanism.
8class SetFrameSync extends Command {
9  /// Creates a command to toggle the FrameSync mechanism.
10  const SetFrameSync(this.enabled, { Duration timeout }) : super(timeout: timeout);
11
12  /// Deserializes this command from the value generated by [serialize].
13  SetFrameSync.deserialize(Map<String, String> params)
14    : enabled = params['enabled'].toLowerCase() == 'true',
15      super.deserialize(params);
16
17  /// Whether frameSync should be enabled or disabled.
18  final bool enabled;
19
20  @override
21  String get kind => 'set_frame_sync';
22
23  @override
24  Map<String, String> serialize() => super.serialize()..addAll(<String, String>{
25    'enabled': '$enabled',
26  });
27}
28
29/// The result of a [SetFrameSync] command.
30class SetFrameSyncResult extends Result {
31  /// Creates a [SetFrameSyncResult].
32  const SetFrameSyncResult();
33
34  /// Deserializes this result from JSON.
35  static SetFrameSyncResult fromJson(Map<String, dynamic> json) {
36    return const SetFrameSyncResult();
37  }
38
39  @override
40  Map<String, dynamic> toJson() => <String, dynamic>{};
41}
42