Skip to content

Commit 000df61

Browse files
author
Chris Yang
committed
[ios] Link PlatformView back to semantics tree (flutter#46471)
The PlatformView does not have a semantics container when added to semantics tree, this PR gives it a semantics container to ensure accessibility traversal works. This fixes flutter/flutter#135504, which is a regression of flutter@b8332e3 Before flutter@b8332e3, the traversal works because the PlatformView is added to the accessibilityElements of the FlutterPlatFormViewSemanticsContainer, which implicitly made the FlutterPlatFormViewSemanticsContainer as the PlatformVIew's AccessibilityContainer. Now we use the PlatformVIew as the nativeAccessibility of the FlutterPlatFormViewSemanticsContainer, we need to expilicitly set the container. This needs to be cherry-picked since the commit caused the regression was cherry-picked in flutter@b8332e3 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 453411b commit 000df61

12 files changed

+254
-168
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,6 +2691,7 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextI
26912691
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h + ../../../flutter/LICENSE
26922692
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.mm + ../../../flutter/LICENSE
26932693
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm + ../../../flutter/LICENSE
2694+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTouchInterceptingView_Test.h + ../../../flutter/LICENSE
26942695
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h + ../../../flutter/LICENSE
26952696
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.mm + ../../../flutter/LICENSE
26962697
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m + ../../../flutter/LICENSE
@@ -2712,6 +2713,8 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_I
27122713
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h + ../../../flutter/LICENSE
27132714
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm + ../../../flutter/LICENSE
27142715
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm + ../../../flutter/LICENSE
2716+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTestMocks.h + ../../../flutter/LICENSE
2717+
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest_mrc.mm + ../../../flutter/LICENSE
27152718
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h + ../../../flutter/LICENSE
27162719
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm + ../../../flutter/LICENSE
27172720
ORIGIN: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController_FlutterScreenAndSceneIfLoadedTest.mm + ../../../flutter/LICENSE
@@ -5455,6 +5458,7 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInp
54555458
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h
54565459
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.mm
54575460
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelayTest.mm
5461+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTouchInterceptingView_Test.h
54585462
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h
54595463
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.mm
54605464
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m
@@ -5476,6 +5480,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_Int
54765480
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h
54775481
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm
54785482
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm
5483+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTestMocks.h
5484+
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTest_mrc.mm
54795485
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h
54805486
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm
54815487
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/UIViewController_FlutterScreenAndSceneIfLoadedTest.mm

shell/platform/darwin/ios/BUILD.gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,11 @@ source_set("ios_test_flutter_mrc") {
238238
"framework/Source/FlutterEngineTest_mrc.mm",
239239
"framework/Source/FlutterPlatformPluginTest.mm",
240240
"framework/Source/FlutterPlatformViewsTest.mm",
241+
"framework/Source/FlutterTouchInterceptingView_Test.h",
241242
"framework/Source/FlutterViewControllerTest_mrc.mm",
242243
"framework/Source/FlutterViewTest.mm",
244+
"framework/Source/SemanticsObjectTestMocks.h",
245+
"framework/Source/SemanticsObjectTest_mrc.mm",
243246
"framework/Source/VsyncWaiterIosTest.mm",
244247
"framework/Source/accessibility_bridge_test.mm",
245248
"platform_message_handler_ios_test.mm",

shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,15 @@ static bool ClipRRectContainsPlatformViewBoundingRect(const SkRRect& clip_rrect,
406406
}
407407

408408
UIView* FlutterPlatformViewsController::GetPlatformViewByID(int64_t view_id) {
409+
return [GetFlutterTouchInterceptingViewByID(view_id) embeddedView];
410+
}
411+
412+
FlutterTouchInterceptingView* FlutterPlatformViewsController::GetFlutterTouchInterceptingViewByID(
413+
int64_t view_id) {
409414
if (views_.empty()) {
410415
return nil;
411416
}
412-
return [touch_interceptors_[view_id].get() embeddedView];
417+
return touch_interceptors_[view_id].get();
413418
}
414419

415420
long FlutterPlatformViewsController::FindFirstResponderPlatformViewId() {
@@ -957,6 +962,10 @@ @implementation FlutterTouchInterceptingView {
957962
fml::scoped_nsobject<DelayingGestureRecognizer> _delayingRecognizer;
958963
FlutterPlatformViewGestureRecognizersBlockingPolicy _blockingPolicy;
959964
UIView* _embeddedView;
965+
// The used as the accessiblityContainer.
966+
// The `accessiblityContainer` is used in UIKit to determine the parent of this accessibility
967+
// node.
968+
NSObject* _flutterAccessibilityContainer;
960969
}
961970
- (instancetype)initWithEmbeddedView:(UIView*)embeddedView
962971
platformViewsController:
@@ -1035,6 +1044,14 @@ - (void)touchesCancelled:(NSSet<UITouch*>*)touches withEvent:(UIEvent*)event {
10351044
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
10361045
}
10371046

1047+
- (void)setFlutterAccessibilityContainer:(NSObject*)flutterAccessibilityContainer {
1048+
_flutterAccessibilityContainer = flutterAccessibilityContainer;
1049+
}
1050+
1051+
- (id)accessibilityContainer {
1052+
return _flutterAccessibilityContainer;
1053+
}
1054+
10381055
@end
10391056

10401057
@implementation DelayingGestureRecognizer {

shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlatformViews.h"
1212
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
1313
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h"
14+
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTouchInterceptingView_Test.h"
1415
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
1516
#import "flutter/shell/platform/darwin/ios/platform_view_ios.h"
1617

@@ -3098,4 +3099,12 @@ - (void)testOnlyPlatformViewsAreRemovedWhenReset {
30983099
XCTAssertEqual(mockFlutterView.subviews.firstObject, someView);
30993100
}
31003101

3102+
- (void)testFlutterTouchInterceptingViewLinksToAccessibilityContainer {
3103+
FlutterTouchInterceptingView* touchInteceptorView =
3104+
[[[FlutterTouchInterceptingView alloc] init] autorelease];
3105+
NSObject* container = [[[NSObject alloc] init] autorelease];
3106+
[touchInteceptorView setFlutterAccessibilityContainer:container];
3107+
XCTAssertEqualObjects([touchInteceptorView accessibilityContainer], container);
3108+
}
3109+
31013110
@end

shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"
1313
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlatformViews.h"
1414
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h"
15+
#import "flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h"
1516
#import "flutter/shell/platform/darwin/ios/ios_context.h"
1617

1718
@class FlutterTouchInterceptingView;
@@ -230,10 +231,17 @@ class FlutterPlatformViewsController {
230231
// Returns the `FlutterPlatformView`'s `view` object associated with the view_id.
231232
//
232233
// If the `FlutterPlatformViewsController` does not contain any `FlutterPlatformView` object or
233-
// a `FlutterPlatformView` object asscociated with the view_id cannot be found, the method
234+
// a `FlutterPlatformView` object associated with the view_id cannot be found, the method
234235
// returns nil.
235236
UIView* GetPlatformViewByID(int64_t view_id);
236237

238+
// Returns the `FlutterTouchInterceptingView` with the view_id.
239+
//
240+
// If the `FlutterPlatformViewsController` does not contain any `FlutterPlatformView` object or
241+
// a `FlutterPlatformView` object associated with the view_id cannot be found, the method
242+
// returns nil.
243+
FlutterTouchInterceptingView* GetFlutterTouchInterceptingViewByID(int64_t view_id);
244+
237245
PostPrerollResult PostPrerollAction(
238246
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger);
239247

@@ -424,6 +432,9 @@ class FlutterPlatformViewsController {
424432

425433
// Get embedded view
426434
- (UIView*)embeddedView;
435+
436+
// Sets flutterAccessibilityContainer as this view's accessibilityContainer.
437+
- (void)setFlutterAccessibilityContainer:(NSObject*)flutterAccessibilityContainer;
427438
@end
428439

429440
@interface UIView (FirstResponder)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
5+
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h"
6+
7+
#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_TOUCH_INTERCEPTING_VIEW_TEST_H_
8+
#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_TOUCH_INTERCEPTING_VIEW_TEST_H_
9+
10+
@interface FlutterTouchInterceptingView (Tests)
11+
- (id)accessibilityContainer;
12+
@end
13+
14+
#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_TOUCH_INTERCEPTING_VIEW_TESTS_H_

shell/platform/darwin/ios/framework/Source/SemanticsObject.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ constexpr float kScrollExtentMaxForInf = 1000;
1818

1919
@class FlutterCustomAccessibilityAction;
2020
@class FlutterPlatformViewSemanticsContainer;
21+
@class FlutterTouchInterceptingView;
2122

2223
/**
2324
* A node in the iOS semantics tree. This object is a wrapper over a native accessibiliy
@@ -171,7 +172,8 @@ constexpr float kScrollExtentMaxForInf = 1000;
171172

172173
- (instancetype)initWithBridge:(fml::WeakPtr<flutter::AccessibilityBridgeIos>)bridge
173174
uid:(int32_t)uid
174-
platformView:(UIView*)platformView NS_DESIGNATED_INITIALIZER;
175+
platformView:(FlutterTouchInterceptingView*)platformView
176+
NS_DESIGNATED_INITIALIZER;
175177

176178
@end
177179

shell/platform/darwin/ios/framework/Source/SemanticsObject.mm

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ @interface FlutterScrollableSemanticsObject ()
157157
@property(nonatomic, retain) FlutterSemanticsScrollView* scrollView;
158158
@end
159159

160-
@implementation FlutterScrollableSemanticsObject {
161-
fml::scoped_nsobject<SemanticsObjectContainer> _container;
162-
}
160+
@implementation FlutterScrollableSemanticsObject
163161

164162
- (instancetype)initWithBridge:(fml::WeakPtr<flutter::AccessibilityBridgeIos>)bridge
165163
uid:(int32_t)uid {
@@ -865,9 +863,10 @@ @implementation FlutterPlatformViewSemanticsContainer
865863

866864
- (instancetype)initWithBridge:(fml::WeakPtr<flutter::AccessibilityBridgeIos>)bridge
867865
uid:(int32_t)uid
868-
platformView:(nonnull UIView*)platformView {
866+
platformView:(nonnull FlutterTouchInterceptingView*)platformView {
869867
if (self = [super initWithBridge:bridge uid:uid]) {
870868
_platformView = [platformView retain];
869+
[platformView setFlutterAccessibilityContainer:self];
871870
}
872871
return self;
873872
}
@@ -882,12 +881,6 @@ - (id)nativeAccessibility {
882881
return _platformView;
883882
}
884883

885-
#pragma mark - UIAccessibilityContainer overrides
886-
887-
- (NSArray*)accessibilityElements {
888-
return @[ _platformView ];
889-
}
890-
891884
@end
892885

893886
@implementation SemanticsObjectContainer {

shell/platform/darwin/ios/framework/Source/SemanticsObjectTest.mm

Lines changed: 1 addition & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -7,97 +7,13 @@
77

88
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
99
#import "flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h"
10+
#import "flutter/shell/platform/darwin/ios/framework/Source/SemanticsObjectTestMocks.h"
1011

1112
FLUTTER_ASSERT_ARC
1213

13-
const CGRect kScreenSize = CGRectMake(0, 0, 600, 800);
14-
15-
namespace flutter {
16-
namespace {
17-
18-
class SemanticsActionObservation {
19-
public:
20-
SemanticsActionObservation(int32_t observed_id, SemanticsAction observed_action)
21-
: id(observed_id), action(observed_action) {}
22-
23-
int32_t id;
24-
SemanticsAction action;
25-
};
26-
27-
class MockAccessibilityBridge : public AccessibilityBridgeIos {
28-
public:
29-
MockAccessibilityBridge() : observations({}) {
30-
view_ = [[UIView alloc] initWithFrame:kScreenSize];
31-
window_ = [[UIWindow alloc] initWithFrame:kScreenSize];
32-
[window_ addSubview:view_];
33-
}
34-
bool isVoiceOverRunning() const override { return isVoiceOverRunningValue; }
35-
UIView* view() const override { return view_; }
36-
UIView<UITextInput>* textInputView() override { return nil; }
37-
void DispatchSemanticsAction(int32_t id, SemanticsAction action) override {
38-
SemanticsActionObservation observation(id, action);
39-
observations.push_back(observation);
40-
}
41-
void DispatchSemanticsAction(int32_t id,
42-
SemanticsAction action,
43-
fml::MallocMapping args) override {
44-
SemanticsActionObservation observation(id, action);
45-
observations.push_back(observation);
46-
}
47-
void AccessibilityObjectDidBecomeFocused(int32_t id) override {}
48-
void AccessibilityObjectDidLoseFocus(int32_t id) override {}
49-
std::shared_ptr<FlutterPlatformViewsController> GetPlatformViewsController() const override {
50-
return nil;
51-
}
52-
std::vector<SemanticsActionObservation> observations;
53-
bool isVoiceOverRunningValue;
54-
55-
private:
56-
UIView* view_;
57-
UIWindow* window_;
58-
};
59-
60-
class MockAccessibilityBridgeNoWindow : public AccessibilityBridgeIos {
61-
public:
62-
MockAccessibilityBridgeNoWindow() : observations({}) {
63-
view_ = [[UIView alloc] initWithFrame:kScreenSize];
64-
}
65-
bool isVoiceOverRunning() const override { return isVoiceOverRunningValue; }
66-
UIView* view() const override { return view_; }
67-
UIView<UITextInput>* textInputView() override { return nil; }
68-
void DispatchSemanticsAction(int32_t id, SemanticsAction action) override {
69-
SemanticsActionObservation observation(id, action);
70-
observations.push_back(observation);
71-
}
72-
void DispatchSemanticsAction(int32_t id,
73-
SemanticsAction action,
74-
fml::MallocMapping args) override {
75-
SemanticsActionObservation observation(id, action);
76-
observations.push_back(observation);
77-
}
78-
void AccessibilityObjectDidBecomeFocused(int32_t id) override {}
79-
void AccessibilityObjectDidLoseFocus(int32_t id) override {}
80-
std::shared_ptr<FlutterPlatformViewsController> GetPlatformViewsController() const override {
81-
return nil;
82-
}
83-
std::vector<SemanticsActionObservation> observations;
84-
bool isVoiceOverRunningValue;
85-
86-
private:
87-
UIView* view_;
88-
};
89-
} // namespace
90-
} // namespace flutter
91-
9214
@interface SemanticsObjectTest : XCTestCase
9315
@end
9416

95-
@interface SemanticsObject (Tests)
96-
- (BOOL)accessibilityScrollToVisible;
97-
- (BOOL)accessibilityScrollToVisibleWithChild:(id)child;
98-
- (id)_accessibilityHitTest:(CGPoint)point withEvent:(UIEvent*)event;
99-
@end
100-
10117
@implementation SemanticsObjectTest
10218

10319
- (void)testCreate {
@@ -203,54 +119,6 @@ - (void)testAccessibilityHitTestNoFocusableItem {
203119
XCTAssertNil(hitTestResult);
204120
}
205121

206-
- (void)testAccessibilityHitTestSearchCanReturnPlatformView {
207-
fml::WeakPtrFactory<flutter::AccessibilityBridgeIos> factory(
208-
new flutter::MockAccessibilityBridge());
209-
fml::WeakPtr<flutter::AccessibilityBridgeIos> bridge = factory.GetWeakPtr();
210-
SemanticsObject* object0 = [[SemanticsObject alloc] initWithBridge:bridge uid:0];
211-
SemanticsObject* object1 = [[SemanticsObject alloc] initWithBridge:bridge uid:1];
212-
SemanticsObject* object3 = [[SemanticsObject alloc] initWithBridge:bridge uid:3];
213-
UIView* platformView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
214-
FlutterPlatformViewSemanticsContainer* platformViewSemanticsContainer =
215-
[[FlutterPlatformViewSemanticsContainer alloc] initWithBridge:bridge
216-
uid:1
217-
platformView:platformView];
218-
219-
object0.children = @[ object1 ];
220-
object0.childrenInHitTestOrder = @[ object1 ];
221-
object1.children = @[ platformViewSemanticsContainer, object3 ];
222-
object1.childrenInHitTestOrder = @[ platformViewSemanticsContainer, object3 ];
223-
224-
flutter::SemanticsNode node0;
225-
node0.id = 0;
226-
node0.rect = SkRect::MakeXYWH(0, 0, 200, 200);
227-
node0.label = "0";
228-
[object0 setSemanticsNode:&node0];
229-
230-
flutter::SemanticsNode node1;
231-
node1.id = 1;
232-
node1.rect = SkRect::MakeXYWH(0, 0, 200, 200);
233-
node1.label = "1";
234-
[object1 setSemanticsNode:&node1];
235-
236-
flutter::SemanticsNode node2;
237-
node2.id = 2;
238-
node2.rect = SkRect::MakeXYWH(0, 0, 100, 100);
239-
node2.label = "2";
240-
[platformViewSemanticsContainer setSemanticsNode:&node2];
241-
242-
flutter::SemanticsNode node3;
243-
node3.id = 3;
244-
node3.rect = SkRect::MakeXYWH(0, 0, 200, 200);
245-
node3.label = "3";
246-
[object3 setSemanticsNode:&node3];
247-
248-
CGPoint point = CGPointMake(10, 10);
249-
id hitTestResult = [object0 _accessibilityHitTest:point withEvent:nil];
250-
251-
XCTAssertEqual(hitTestResult, platformView);
252-
}
253-
254122
- (void)testAccessibilityScrollToVisible {
255123
fml::WeakPtrFactory<flutter::MockAccessibilityBridge> factory(
256124
new flutter::MockAccessibilityBridge());
@@ -895,27 +763,6 @@ - (void)testShouldDispatchShowOnScreenActionForHidden {
895763
XCTAssertTrue(bridge->observations[0].action == flutter::SemanticsAction::kShowOnScreen);
896764
}
897765

898-
- (void)testFlutterPlatformViewSemanticsContainer {
899-
fml::WeakPtrFactory<flutter::MockAccessibilityBridge> factory(
900-
new flutter::MockAccessibilityBridge());
901-
fml::WeakPtr<flutter::MockAccessibilityBridge> bridge = factory.GetWeakPtr();
902-
__weak UIView* weakPlatformView;
903-
@autoreleasepool {
904-
UIView* platformView = [[UIView alloc] init];
905-
906-
FlutterPlatformViewSemanticsContainer* container =
907-
[[FlutterPlatformViewSemanticsContainer alloc] initWithBridge:bridge
908-
uid:1
909-
platformView:platformView];
910-
XCTAssertEqualObjects(container.accessibilityElements, @[ platformView ]);
911-
weakPlatformView = platformView;
912-
XCTAssertNotNil(weakPlatformView);
913-
}
914-
// Check if there's no more strong references to `platformView` after container and platformView
915-
// are released.
916-
XCTAssertNil(weakPlatformView);
917-
}
918-
919766
- (void)testFlutterSwitchSemanticsObjectMatchesUISwitch {
920767
fml::WeakPtrFactory<flutter::MockAccessibilityBridge> factory(
921768
new flutter::MockAccessibilityBridge());

0 commit comments

Comments
 (0)