mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-15 12:36:23 +00:00
* fix(canvas): harden hosted Canvas on macOS Resolve Gateway-hosted Canvas and A2UI targets through refreshed node capabilities, keep bridge and live-reload behavior correct, and restrict native action dispatch to the exact trusted main-frame document. Preserve scalar evaluation results, secure action IDs, and hidden state-directory watching. Co-authored-by: GuoJiaming <804436395@qq.com> Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com> Co-authored-by: zeng-weihan <ceng.weihan@xydigit.com> * chore(canvas): defer release note * chore(canvas): refresh native i18n inventory * refactor(canvas): isolate hosted surface resolution --------- Co-authored-by: GuoJiaming <804436395@qq.com> Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com> Co-authored-by: zeng-weihan <ceng.weihan@xydigit.com>
18 lines
845 B
Swift
18 lines
845 B
Swift
import Foundation
|
|
import Testing
|
|
@testable import OpenClawKit
|
|
|
|
#if canImport(WebKit)
|
|
struct WebViewJavaScriptSupportTests {
|
|
@Test func `evaluation results preserve boolean and numeric scalars`() {
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(NSNumber(value: false)) == "false")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(NSNumber(value: true)) == "true")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(NSNumber(value: 0)) == "0")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(NSNumber(value: 1)) == "1")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(NSNumber(value: 1.5)) == "1.5")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString("") == "")
|
|
#expect(WebViewJavaScriptSupport.evaluationResultString(nil) == "")
|
|
}
|
|
}
|
|
#endif
|