Files
HaishinKit.swift/HaishinKit/Tests/Screen/ScreenObjectSnapshotTests.swift
shogo4405 de6def6aae Align file names and interfaces with the other platforms for ScreenObject. (#1880)
* Rename VideoTrackScreenObject -> VideoScreenObject.

* ScreenObjectSnapshot.frame -> ScreenObjectSnapshot.size

* Support data scheme image source for ImageScreenObject.

* Add Test.
2026-02-16 00:44:28 +09:00

19 lines
710 B
Swift

import AVFoundation
import Foundation
import Testing
@testable import HaishinKit
@ScreenActor
@Suite struct ScreenObjectSnapshotTests {
@Test func videoSnapshot() throws {
let string = """
{"type":"video","id":"1771162233189358-1238207813","size":{"width":90,"height":160},"isVisible":true,"layoutMargin":{"top":16,"left":0,"bottom":0,"right":16},"horizontalAlignment":2,"verticalAlignment":0,"elements":{"track":"1"},"children":[]}
""".data(using: .utf8)!
let snapshot = try JSONDecoder().decode(ScreenObjectSnapshot.self, from: string)
#expect(snapshot.type == "video")
#expect(snapshot.horizontalAlignment == 2)
#expect(snapshot.verticalAlignment == 0)
}
}