Unverified Commit 0fa95b75 authored by Ivan Matkov's avatar Ivan Matkov Committed by GitHub

Remove deprecated OS/Arch values (#1165)

parent 5a908332
......@@ -7,9 +7,6 @@ enum class OS(val id: String) {
MacOS("macos"),
Ios("ios"),
Tvos("tvos"),
@Deprecated("JS is invalid host OS name. Consider using enum KotlinBackend to detect JS.")
JS("js"),
Unknown("unknown")
;
......@@ -26,10 +23,6 @@ enum class OS(val id: String) {
enum class Arch(val id: String) {
X64("x64"),
Arm64("arm64"),
@Deprecated("JS is not valid Arch value")
JS("js"),
@Deprecated("WASM is not valid Arch value")
WASM("wasm"),
Unknown("unknown"),
;
}
......
package org.jetbrains.skiko.tests.org.jetbrains.skiko
package org.jetbrains.skiko
import org.jetbrains.skiko.OS
import org.jetbrains.skiko.detectHostOs
import org.jetbrains.skiko.hostOs
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals
class HostOsTest {
@Test
fun canGetHostOs() {
assertNotEquals(OS.JS, hostOs)
}
@Test
fun canGetLinux() {
spoofUserAgentData("linux")
......@@ -51,6 +42,13 @@ class HostOsTest {
}
}
private fun spoofUserAgentData(newValue: String) =
js("""navigator.__defineGetter__('userAgentData', function () { return { platform:newValue }; });""")
private fun spoofUserAgentData(newValue: String) {
val userAgentData = js("({})")
userAgentData.platform = newValue
js(
"""Object.defineProperty(navigator, 'userAgentData', {
configurable: true,
value: userAgentData
});"""
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment