Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 02970d6

Browse files
committed
Guarantee hasStrings will be true when tested
1 parent e502d05 commit 02970d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ - (void)testHasStrings {
2121
std::make_unique<fml::WeakPtrFactory<FlutterEngine>>(engine);
2222
FlutterPlatformPlugin* plugin =
2323
[[FlutterPlatformPlugin alloc] initWithEngine:_weakFactory->GetWeakPtr()];
24+
25+
// Set some string to the pasteboard.
26+
__block bool calledSet = false;
27+
FlutterResult resultSet = ^(id result) {
28+
calledSet = true;
29+
};
30+
FlutterMethodCall* methodCallSet =
31+
[FlutterMethodCall methodCallWithMethodName:@"Clipboard.setClipboardData" arguments:@{@"text": @"some string"}];
32+
[plugin handleMethodCall:methodCallSet result:resultSet];
33+
XCTAssertEqual(calledSet, true);
34+
35+
// Call hasStrings and expect it to be true.
2436
__block bool called = false;
2537
__block bool value;
2638
FlutterResult result = ^(id result) {

0 commit comments

Comments
 (0)