Flutter Engine
 
Loading...
Searching...
No Matches
embedder_frozen_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
8
9namespace flutter {
10namespace testing {
11
12// Assert that both types have the same member with the same offset.
13// This prevents reordering of "frozen" embedder API struct members.
14#define ASSERT_EQ_OFFSET(type1, type2, member) \
15 ASSERT_EQ(offsetof(type1, member), offsetof(type2, member))
16
17// New members must not be added to `FlutterTransformation`
18// as it would break the ABI of `FlutterSemanticsNode`.
19// See: https://github.com/flutter/flutter/issues/121176
31
32// New members must not be added to `FlutterRect` as it would
33// break the ABI of `FlutterSemanticsNode` and `FlutterDamage`.
34// See: https://github.com/flutter/flutter/issues/121176
35// See: https://github.com/flutter/flutter/issues/121347
42
43// New members must not be added to `FlutterPoint` as it would
44// break the ABI of `FlutterLayer`.
49
50// New members must not be added to `FlutterDamage` as it would
51// break the ABI of `FlutterPresentInfo`.
52TEST(EmbedderFrozen, FlutterDamageIsFrozen) {
56}
57
58// New members must not be added to `FlutterSemanticsNode`
59// as it would break the ABI of `FlutterSemanticsUpdate`.
60// See: https://github.com/flutter/flutter/issues/121176
61TEST(EmbedderFrozen, FlutterSemanticsNodeIsFrozen) {
62 ASSERT_EQ(sizeof(FlutterSemanticsNode), sizeof(FrozenFlutterSemanticsNode));
63
65 struct_size);
70 text_selection_base);
72 text_selection_extent);
74 scroll_child_count);
76 scroll_index);
78 scroll_position);
80 scroll_extent_max);
82 scroll_extent_min);
89 increased_value);
91 decreased_value);
93 text_direction);
97 child_count);
99 children_in_traversal_order);
101 children_in_hit_test_order);
103 custom_accessibility_actions_count);
105 custom_accessibility_actions);
107 platform_view_id);
110 heading_level);
111}
112
113// New members must not be added to `FlutterSemanticsCustomAction`
114// as it would break the ABI of `FlutterSemanticsUpdate`.
115// See: https://github.com/flutter/flutter/issues/121176
131
132} // namespace testing
133} // namespace flutter
int32_t value
int32_t x
#define ASSERT_EQ_OFFSET(type1, type2, member)
double y
TEST(NativeAssetsManagerTest, NoAvailableAssets)
A structure to represent a damage region.
Definition embedder.h:664
A structure to represent a 2D point.
Definition embedder.h:649
A structure to represent a rectangle.
Definition embedder.h:641