Skip to content

Commit c69226f

Browse files
authored
[webview_flutter_wkwebview] Fix testNilRequest test for macOS 15.5 (#9330)
This test was introduced in #8766 to fix a crash when `WKFrameInfo.request` returned nil. It appears that macOS 15.5 fixed `WKFrameInfo.request` so it no longer returns nil and instead returns an empty `URLRequest`. This updates the test to accept either `nil` or an empty `URLRequest`. Fixes flutter/flutter#169511. ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 5743798 commit c69226f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FrameInfoProxyAPITests.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ class FrameInfoProxyAPITests: XCTestCase {
3535

3636
let instance = TestFrameInfoWithNilRequest()
3737
let value = try? api.pigeonDelegate.request(pigeonApi: api, pigeonInstance: instance)
38-
39-
XCTAssertNil(value)
38+
// On macOS 15.5+, `WKFrameInfo.request` returns with an empty URLRequest.
39+
// Previously it would return nil so accept either.
40+
if value != nil {
41+
XCTAssertEqual(value?.value.url?.absoluteString, "")
42+
} else {
43+
XCTAssertNil(value)
44+
}
4045
}
4146
}
4247

0 commit comments

Comments
 (0)