feat: webview manager and js bridge skeleton

This commit is contained in:
2026-08-16 16:01:36 +08:00
parent a764208c0e
commit 394a553da7
5 changed files with 93 additions and 0 deletions
@@ -0,0 +1,14 @@
package top.yeij.hearth.webview
import org.junit.Assert.assertTrue
import org.junit.Test
class JsBridgeTest {
@Test
fun getDeviceInfo_returnsJsonWithDarkMode() {
val bridge = JsBridge(deviceWidthPx = 800, deviceHeightPx = 480, density = 2.0f, darkMode = true)
val json = bridge.getDeviceInfo()
assertTrue(json.contains("\"widthPx\":800"))
assertTrue(json.contains("\"darkMode\":true"))
}
}